{
  "info": {
    "_postman_id": "3dccc108-d8b8-436f-89be-b23f5e57a506",
    "name": "Протокол 1.4 Инвалидность",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "_exporter_id": "37937048"
  },
  "item": [
    {
      "name": "Предварительные условия",
      "item": [
        {
          "name": "предварительные условия",
          "item": [
            {
              "name": "metadata",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "var responseData = pm.response.json();\r",
                      "\r",
                      "if (responseData.entry && responseData.entry.length > 1) {\r",
                      "    var practitioner = responseData.entry[1].resource;\r",
                      "    if (practitioner.resourceType === \"Practitioner\") {\r",
                      "        pm.environment.set(\"PractitionerMREC\", practitioner.id);\r",
                      "        console.log(\"Practitioner ID saved: \" + practitioner.id);\r",
                      "    }\r",
                      "}\r",
                      ""
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "protocolProfileBehavior": {
                "disableBodyPruning": true
              },
              "request": {
                "method": "GET",
                "header": [],
                "body": {
                  "mode": "raw",
                  "raw": "",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "https://{{Proxy-host}}/fhir/metadata",
                  "protocol": "https",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "metadata"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "поиск врача",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "var responseData = pm.response.json();\r",
                      "\r",
                      "if (responseData.entry && responseData.entry.length > 1) {\r",
                      "    var practitioner = responseData.entry[1].resource;\r",
                      "    if (practitioner.resourceType === \"Practitioner\") {\r",
                      "        // Сохраняем ID практика\r",
                      "        pm.environment.set(\"PractitionerMREC\", practitioner.id);\r",
                      "        console.log(\"Practitioner ID saved: \" + practitioner.id);\r",
                      "        \r",
                      "        // Сохраняем ФИО практика\r",
                      "        if (practitioner.name?.[0]) {\r",
                      "            var nameData = practitioner.name[0];\r",
                      "            var fullName = [\r",
                      "                nameData.family,\r",
                      "                ...(nameData.given || [])\r",
                      "            ].filter(Boolean).join(' ');\r",
                      "            \r",
                      "            pm.environment.set(\"PractitionerName\", fullName);\r",
                      "            console.log(\"ФИО сохранено: \" + fullName);\r",
                      "        }\r",
                      "    }\r",
                      "}"
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "protocolProfileBehavior": {
                "disableBodyPruning": true
              },
              "request": {
                "method": "GET",
                "header": [],
                "body": {
                  "mode": "raw",
                  "raw": "",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Practitioner?name=Иванов Владислав Эдуардович",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Practitioner"
                  ],
                  "query": [
                    {
                      "key": "name",
                      "value": "Иванов Владислав Эдуардович"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "поиск роли",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "// Parse the response JSON\r",
                      "var responseData = pm.response.json();\r",
                      "\r",
                      "// Find the PractitionerRole with MRECchairman position type\r",
                      "var entries = responseData.entry;\r",
                      "\r",
                      "if (entries) {\r",
                      "    for (var i = 0; i < entries.length; i++) {\r",
                      "        var entry = entries[i];\r",
                      "        var resource = entry.resource;\r",
                      "        \r",
                      "        if (resource && resource.resourceType === \"PractitionerRole\") {\r",
                      "            // Check extensions for MRECchairman position type\r",
                      "            var extensions = resource.extension || [];\r",
                      "            \r",
                      "            var mrecPosition = extensions.find(function(ext) {\r",
                      "                return ext.url === \"https://fhir.by/StructureDefinition/PractitionerPosition\" && \r",
                      "                       ext.extension && \r",
                      "                       ext.extension.some(function(posExt) {\r",
                      "                           return posExt.url === \"https://fhir.by/StructureDefinition/PractitionerPositionType\" && \r",
                      "                                  posExt.valueCodeableConcept && \r",
                      "                                  posExt.valueCodeableConcept.coding && \r",
                      "                                  posExt.valueCodeableConcept.coding.some(function(coding) {\r",
                      "                                      return coding.code === \"MRECchairman\";\r",
                      "                                  });\r",
                      "                       });\r",
                      "            });\r",
                      "            \r",
                      "            if (mrecPosition) {\r",
                      "                var practitionerRoleId = resource.id;\r",
                      "                pm.environment.set(\"PractitionerRoleMREC\", practitionerRoleId);\r",
                      "                console.log(\"✅ PractitionerRole MRECchairman ID saved: \" + practitionerRoleId);\r",
                      "                \r",
                      "                // Extract role display name\r",
                      "                var positionTypeExt = mrecPosition.extension.find(function(posExt) {\r",
                      "                    return posExt.url === \"https://fhir.by/StructureDefinition/PractitionerPositionType\";\r",
                      "                });\r",
                      "                \r",
                      "                if (positionTypeExt?.valueCodeableConcept?.coding?.[0]?.display) {\r",
                      "                    var roleDisplay = positionTypeExt.valueCodeableConcept.coding[0].display;\r",
                      "                    pm.environment.set(\"PractitionerRoleName\", roleDisplay);\r",
                      "                    console.log(\"✅ PractitionerRole display saved: \" + roleDisplay);\r",
                      "                }\r",
                      "                break;\r",
                      "            }\r",
                      "        }\r",
                      "    }\r",
                      "}\r",
                      "\r",
                      "// Final check\r",
                      "if (!pm.environment.get(\"PractitionerRoleMREC\")) {\r",
                      "    console.log(\"❌ No PractitionerRole with MRECchairman position type found\");\r",
                      "}"
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "protocolProfileBehavior": {
                "disableBodyPruning": true
              },
              "request": {
                "method": "GET",
                "header": [],
                "body": {
                  "mode": "raw",
                  "raw": "",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{FHIR_BASE}}/PractitionerRole?practitioner={{PractitionerId}}",
                  "host": [
                    "{{FHIR_BASE}}"
                  ],
                  "path": [
                    "PractitionerRole"
                  ],
                  "query": [
                    {
                      "key": "practitioner",
                      "value": "{{PractitionerId}}"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Миграции",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "// Parse the response JSON\r",
                      "var responseData = pm.response.json();\r",
                      "\r",
                      "// Find the PractitionerRole with MRECchairman position type\r",
                      "var entries = responseData.entry;\r",
                      "\r",
                      "if (entries) {\r",
                      "    for (var i = 0; i < entries.length; i++) {\r",
                      "        var entry = entries[i];\r",
                      "        var resource = entry.resource;\r",
                      "        \r",
                      "        if (resource && resource.resourceType === \"PractitionerRole\") {\r",
                      "            // Check extensions for MRECchairman position type\r",
                      "            var extensions = resource.extension || [];\r",
                      "            \r",
                      "            var mrecPosition = extensions.find(function(ext) {\r",
                      "                return ext.url === \"https://fhir.by/StructureDefinition/PractitionerPosition\" && \r",
                      "                       ext.extension && \r",
                      "                       ext.extension.some(function(posExt) {\r",
                      "                           return posExt.url === \"https://fhir.by/StructureDefinition/PractitionerPositionType\" && \r",
                      "                                  posExt.valueCodeableConcept && \r",
                      "                                  posExt.valueCodeableConcept.coding && \r",
                      "                                  posExt.valueCodeableConcept.coding.some(function(coding) {\r",
                      "                                      return coding.code === \"MRECchairman\";\r",
                      "                                  });\r",
                      "                       });\r",
                      "            });\r",
                      "            \r",
                      "            if (mrecPosition) {\r",
                      "                var practitionerRoleId = resource.id;\r",
                      "                pm.environment.set(\"PractitionerRoleMREC\", practitionerRoleId);\r",
                      "                console.log(\"✅ PractitionerRole MRECchairman ID saved: \" + practitionerRoleId);\r",
                      "                \r",
                      "                // Extract role display name\r",
                      "                var positionTypeExt = mrecPosition.extension.find(function(posExt) {\r",
                      "                    return posExt.url === \"https://fhir.by/StructureDefinition/PractitionerPositionType\";\r",
                      "                });\r",
                      "                \r",
                      "                if (positionTypeExt?.valueCodeableConcept?.coding?.[0]?.display) {\r",
                      "                    var roleDisplay = positionTypeExt.valueCodeableConcept.coding[0].display;\r",
                      "                    pm.environment.set(\"PractitionerRoleName\", roleDisplay);\r",
                      "                    console.log(\"✅ PractitionerRole display saved: \" + roleDisplay);\r",
                      "                }\r",
                      "                break;\r",
                      "            }\r",
                      "        }\r",
                      "    }\r",
                      "}\r",
                      "\r",
                      "// Final check\r",
                      "if (!pm.environment.get(\"PractitionerRoleMREC\")) {\r",
                      "    console.log(\"❌ No PractitionerRole with MRECchairman position type found\");\r",
                      "}"
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "request": {
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJJM2Z1ZlVhUmhBQVZ3Y3hsYW9EWFNBMTRkZlFrcDBRWkZmY1ppOFhEZktjIn0.eyJleHAiOjE3NzQ5NTY0MTMsImlhdCI6MTc3NDk1NjExMywiYXV0aF90aW1lIjoxNzc0OTU0NDQyLCJqdGkiOiI3MjFmMzYwYi00N2IxLTQ0OWItODA3Yy00ODY2MzQ3Zjc5MTAiLCJpc3MiOiJodHRwczovL3ByZXByb2QuY2lzei5ieS9hdXRoL2FwaS9yZWFsbXMvdGVybSIsImF1ZCI6InRlcm0uYXBpIiwic3ViIjoiODgwMGY3YWYtOWFlNi00OWQzLTg2MDctOWExNWMzNzcwMGNjIiwidHlwIjoiQmVhcmVyIiwiYXpwIjoidGVybS5wcmFjdGl0aW9uZXIud2ViIiwic2Vzc2lvbl9zdGF0ZSI6ImUzYzNmYWUzLTZkMTgtNDk3NS04NmFlLTk4MzNlNjdiMDEyOSIsImFjciI6IjEiLCJhbGxvd2VkLW9yaWdpbnMiOlsiaHR0cHM6Ly9wcmVwcm9kLmNpc3ouYnkiXSwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbInRlcm0ub3JnYW5pemF0aW9uLmFkbWluaXN0cmF0b3IiLCJ0ZXJtLmNvZGUtc3lzdGVtLmFkbWluaXN0cmF0b3IiLCJ0ZXJtLnByYWN0aXRpb25lci5hZG1pbmlzdHJhdG9yIl19LCJzY29wZSI6Im9wZW5pZCB0ZXJtX2F1ZGllbmNlIGVtYWlsIHByYWN0aXRpb25lcl9pZCBzZXNzaW9uX21heF9pZGxlX3RpbWUgdW5wIGRlcGFydG1lbnRfaWRzIHJlYWxtIG9yZ2FuaXphdGlvbl9pZCIsInNpZCI6ImUzYzNmYWUzLTZkMTgtNDk3NS04NmFlLTk4MzNlNjdiMDEyOSIsImVtYWlsX3ZlcmlmaWVkIjp0cnVlLCJwcmFjdGl0aW9uZXJfaWQiOiJkMTNlNDg4YS0yNjk2LTExZjEtYWJmNC01ZDM5NzE0ZmRlNDQiLCJ1bnAiOiIxOTM2MDU3MjkiLCJvcmdhbml6YXRpb25faWQiOiJkNDcyYjhkNi01YzgwLTRkZmItYWQwOS1jNWNlODU5NmQ1ZTkiLCJzZXNzaW9uX21heF9pZGxlX3RpbWUiOiIxODAwIiwicmVhbG0iOiJ0ZXJtIiwiZW1haWwiOiJpdmVAYWdzci5ieSIsImRlcGFydG1lbnRfaWRzIjpbImQ0NzJiOGQ2LTVjODAtNGRmYi1hZDA5LWM1Y2U4NTk2ZDVlOSJdfQ.o5ll3bb-cVZ1xD-GHvUzWbs8o7LLdXEc2zi-ZF27_Fic8V9sPaHJXn5LnftzaUUmjK0FbIzArlZkXBF6CKsjYJhX-a_uEE23jI9ygWMUzH9UtUsNH0s_EheeIWyxM65sGdRd6FXfEs1NAyrQp7JUAfuNDp-sTeScC3CXi65gR0b5H63bwne_GZNUiEuXkyeHkBYSpw0say7A3M_KowupP7vZCogEXOCBWcbTK_eaYFWK8FSfB8h_AjcQZLjXRfEJDJJBY4wK0N8aUHIf3ZSeqp7RAyQdVZ9behHvzJ5a6aBz_k9YlOJPqqsDSpTtqWfjel2q5US17CeClHrf6ewrKw",
                      "type": "string"
                    }
                  ]
                },
                "method": "POST",
                "header": [],
                "body": {
                  "mode": "raw",
                  "raw": "",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "https://preprod.cisz.by/api/practitioner/Practitioner/applyAllMigrations",
                  "protocol": "https",
                  "host": [
                    "preprod",
                    "cisz",
                    "by"
                  ],
                  "path": [
                    "api",
                    "practitioner",
                    "Practitioner",
                    "applyAllMigrations"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Поиск организации",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "var responseData = pm.response.json();\r",
                      "var organization = null;\r",
                      "\r",
                      "if (responseData.entry && responseData.entry.length > 0) {\r",
                      "    // Ищем ресурс типа Organization среди всех entry\r",
                      "    for (var i = 0; i < responseData.entry.length; i++) {\r",
                      "        var resource = responseData.entry[i].resource;\r",
                      "        if (resource && resource.resourceType === \"Organization\") {\r",
                      "            organization = resource;\r",
                      "            break;\r",
                      "        }\r",
                      "    }\r",
                      "}\r",
                      "\r",
                      "if (organization) {\r",
                      "    // Проверяем наличие идентификатора mrec\r",
                      "    var hasMRECIdentifier = organization.identifier?.some(function(identifier) {\r",
                      "        return identifier.type?.coding?.some(function(coding) {\r",
                      "            return coding.code === \"mrec\" && coding.system === \"https://fhir.by/ValueSet/OrganizationIdentifierType\";\r",
                      "        });\r",
                      "    });\r",
                      "    \r",
                      "    if (hasMRECIdentifier) {\r",
                      "        pm.environment.set(\"OrganizationMREC\", organization.id);\r",
                      "        console.log(\"✅ MREC Organization ID saved: \" + organization.id);\r",
                      "        \r",
                      "        if (organization.name) {\r",
                      "            var escapedName = organization.name.replace(/\"/g, '\\\\\"');\r",
                      "            pm.environment.set(\"OrganizationName\", escapedName);\r",
                      "            console.log(\"✅ Organization name saved: \" + escapedName);\r",
                      "        }\r",
                      "        \r",
                      "        var mrecIdentifier = organization.identifier?.find(function(ident) {\r",
                      "            return ident.type?.coding?.some(function(coding) {\r",
                      "                return coding.code === \"mrec\";\r",
                      "            });\r",
                      "        });\r",
                      "        \r",
                      "        if (mrecIdentifier?.value) {\r",
                      "            pm.environment.set(\"codeMREC\", mrecIdentifier.value);\r",
                      "            console.log(\"✅ MREC code saved: \" + mrecIdentifier.value);\r",
                      "        }\r",
                      "    } else {\r",
                      "        console.log(\"❌ Organization does not have MREC identifier\");\r",
                      "    }\r",
                      "} else {\r",
                      "    console.log(\"No Organization found in the response\");\r",
                      "}"
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "protocolProfileBehavior": {
                "disableBodyPruning": true
              },
              "request": {
                "method": "GET",
                "header": [],
                "body": {
                  "mode": "raw",
                  "raw": "",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{FHIR_BASE}}/Organization?_id={{organizationId}}",
                  "host": [
                    "{{FHIR_BASE}}"
                  ],
                  "path": [
                    "Organization"
                  ],
                  "query": [
                    {
                      "key": "name",
                      "value": "Учреждение здравоохранения \\\"Витебская областная медико-реабилитационная экспертная комиссия\\\"",
                      "disabled": true
                    },
                    {
                      "key": "_id",
                      "value": "{{organizationId}}"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Поиск структурного подразделения",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "var responseData = pm.response.json();\r",
                      "\r",
                      "if (responseData.entry && responseData.entry.length > 0) {\r",
                      "    var locationFound = false;\r",
                      "    \r",
                      "    // Ищем ресурс Location среди всех entry\r",
                      "    for (var i = 0; i < responseData.entry.length; i++) {\r",
                      "        var resource = responseData.entry[i].resource;\r",
                      "        \r",
                      "        if (resource && resource.resourceType === \"Location\") {\r",
                      "            locationFound = true;\r",
                      "            var locationId = resource.id;\r",
                      "            pm.environment.set(\"LocationMREC\", locationId);\r",
                      "            console.log(\"✅ Location ID saved: \" + locationId);\r",
                      "            \r",
                      "            // Save location name\r",
                      "            if (resource.name) {\r",
                      "                pm.environment.set(\"LocationName\", resource.name);\r",
                      "                console.log(\"✅ Location name saved: \" + resource.name);\r",
                      "            }\r",
                      "            \r",
                      "            // Extract MREC code from location identifiers\r",
                      "            var mrecIdentifier = resource.identifier?.find(ident => \r",
                      "                ident.type?.coding?.some(coding => coding.code === \"mrec\")\r",
                      "            );\r",
                      "            \r",
                      "            if (mrecIdentifier?.value) {\r",
                      "                pm.environment.set(\"codeMrecLocation\", mrecIdentifier.value);\r",
                      "                console.log(\"✅ Location MREC code saved: \" + mrecIdentifier.value);\r",
                      "            }\r",
                      "            \r",
                      "            if (resource.managingOrganization?.reference) {\r",
                      "                console.log(\"Managing organization: \" + resource.managingOrganization.reference);\r",
                      "            }\r",
                      "            \r",
                      "            break; // Выходим из цикла после нахождения первого Location\r",
                      "        }\r",
                      "    }\r",
                      "    \r",
                      "    if (!locationFound) {\r",
                      "        console.log(\"No Location found in the response\");\r",
                      "    }\r",
                      "} else {\r",
                      "    console.log(\"No entries in the response\");\r",
                      "}"
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "protocolProfileBehavior": {
                "disableBodyPruning": true
              },
              "request": {
                "method": "GET",
                "header": [],
                "body": {
                  "mode": "raw",
                  "raw": "",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{FHIR_BASE}}/Location?organization=Organization/{{OrganizationId}}",
                  "host": [
                    "{{FHIR_BASE}}"
                  ],
                  "path": [
                    "Location"
                  ],
                  "query": [
                    {
                      "key": "name",
                      "value": "Межрайонная МРЭК №1",
                      "disabled": true
                    },
                    {
                      "key": "_id",
                      "value": "{{LocationId}}",
                      "disabled": true
                    },
                    {
                      "key": "organization",
                      "value": "Organization/{{OrganizationId}}"
                    }
                  ]
                }
              },
              "response": []
            }
          ]
        },
        {
          "name": "Кейс 1. Пациент направлен на медико-социальную экспертизу для освидетельствования. Установлена группа инвалидности.  Признан инвалидом впервые. Сформирована индивидуальная программа реабилитации инвалида.",
          "item": [
            {
              "name": "Создание пациента",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Валидный бандл должен отработать со статусом 202\", function () {\r\n    pm.response.to.have.status(202);\r\n});\r\n\r\nvar jsonData = pm.response.json();\r\nlet bundleId = jsonData.parameter.find(obj => obj.name === \"ResourceId\").valueString;\r\nlet statusReference = jsonData.parameter.find(obj => obj.name === \"OperationStatusReference\");\r\n\r\nconsole.log(statusReference.valueReference.reference);\r\n\r\npm.collectionVariables.set(\"bundleId\", bundleId);\r\npm.collectionVariables.set(\"StatusUrl\", statusReference.valueReference.reference);\r\n"
                    ]
                  }
                }
              ],
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Fhir-By-Version",
                    "value": "active"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\r\n    \"resourceType\": \"Patient\",\r\n    \"id\": \"PatientBundleForTest\",\r\n    \"meta\": {\r\n        \"profile\": [\r\n            \"https://fhir.by/StructureDefinition/PatientWithIdentificationNumber\"\r\n        ]\r\n    },\r\n    \"identifier\": [\r\n        {\r\n            \"type\": {\r\n                \"coding\": [\r\n                    {\r\n                        \"system\": \"https://fhir.by/ValueSet/PersonalDocumentType\",\r\n                        \"code\": \"INP\"\r\n                    }\r\n                ]\r\n            },\r\n            \"value\": \"7551231A009PB1\"\r\n        },\r\n        {\r\n            \"extension\": [\r\n                {\r\n                    \"extension\": [\r\n                        {\r\n                            \"url\": \"https://fhir.by/StructureDefinition/PassportIssuedString\",\r\n                            \"valueString\": \"Центральным РУВД г Минска, 2024-01-31\"\r\n                        },\r\n                        {\r\n                            \"url\": \"https://fhir.by/StructureDefinition/PassportIssuedDate\",\r\n                            \"valueDate\": \"2024-01-31\"\r\n                        },\r\n                        {\r\n                            \"url\": \"https://fhir.by/StructureDefinition/PassportIssuedCode\",\r\n                            \"valueCodeableConcept\": {\r\n                                \"coding\": [\r\n                                    {\r\n                                        \"system\": \"https://fhir.by/ValueSet/OCAM\",\r\n                                        \"code\": \"106\"\r\n                                    }\r\n                                ]\r\n                            }\r\n                        }\r\n                    ],\r\n                    \"url\": \"https://fhir.by/StructureDefinition/PassportIssued\"\r\n                }\r\n            ],\r\n            \"use\": \"usual\",\r\n            \"type\": {\r\n                \"coding\": [\r\n                    {\r\n                        \"system\": \"https://fhir.by/ValueSet/PersonalDocumentType\",\r\n                        \"code\": \"CDP\"\r\n                    }\r\n                ]\r\n            },\r\n            \"period\": {\r\n                \"start\": \"2025-09-20\"\r\n            },\r\n            \"value\": \"15№ 0003839\",\r\n            \"assigner\": {\r\n                \"reference\": \"Organization/{{OrganizationMREC}}\"\r\n            }\r\n        }\r\n    ],\r\n    \"extension\": [\r\n        {\r\n            \"extension\": [\r\n                {\r\n                    \"url\": \"https://fhir.by/StructureDefinition/PatientJobProfession\",\r\n                    \"valueString\": \"Токарь\"\r\n                },\r\n                {\r\n                    \"url\": \"https://fhir.by/StructureDefinition/PatientJobProfessionCode\",\r\n                    \"valueCodeableConcept\": {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/SpecialtyProfPerson\",\r\n                                \"code\": \"7223-093\",\r\n                                \"display\": \"Токарь-расточник\"\r\n                            }\r\n                        ]\r\n                    }\r\n                },\r\n                {\r\n                    \"url\": \"https://fhir.by/StructureDefinition/PatientJobPlace\",\r\n                    \"valueString\": \"Минский подшипниковый завод\"\r\n                },\r\n                {\r\n                    \"url\": \"https://fhir.by/StructureDefinition/TermOFWork\",\r\n                    \"valuePeriod\": {\r\n                        \"start\": \"2024-01-01\"\r\n                    }\r\n                },\r\n                {\r\n                    \"url\": \"https://fhir.by/StructureDefinition/MainJobPlace\",\r\n                    \"valueBoolean\": true\r\n                }\r\n            ],\r\n            \"url\": \"https://fhir.by/StructureDefinition/PatientJob\"\r\n        },\r\n        {\r\n            \"url\": \"https://fhir.by/StructureDefinition/DisabilityGroup\",\r\n            \"valueCodeableConcept\": {\r\n                \"coding\": [\r\n                    {\r\n                        \"system\": \"https://fhir.by/ValueSet/DisabilityGroup\",\r\n                        \"code\": \"2_group\",\r\n                        \"display\": \"II группа\"\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"url\": \"https://fhir.by/StructureDefinition/DisabilityReason\",\r\n            \"valueCodeableConcept\": {\r\n                \"coding\": [\r\n                    {\r\n                        \"system\": \"https://fhir.by/ValueSet/DisabilityReason\",\r\n                        \"code\": \"general\",\r\n                        \"display\": \"общее заболевание\"\r\n                    }\r\n                ]\r\n            }\r\n        }\r\n    ],\r\n    \"active\": true,\r\n    \"name\": [\r\n        {\r\n            \"family\": \"Иванов\",\r\n            \"given\": [\r\n                \"Петр\",\r\n                \"Сидорович\"\r\n            ]\r\n        }\r\n    ],\r\n    \"telecom\": [\r\n        {\r\n            \"extension\": [\r\n                {\r\n                    \"url\": \"https://fhir.by/StructureDefinition/PatientTelecomPurpose\",\r\n                    \"extension\": [\r\n                        {\r\n                            \"url\": \"https://fhir.by/StructureDefinition/PatientNotificationType\",\r\n                            \"valueCodeableConcept\": {\r\n                                \"coding\": [\r\n                                    {\r\n                                        \"system\": \"https://fhir.by/ValueSet/PatientNotificationType\",\r\n                                        \"code\": \"SMS\"\r\n                                    }\r\n                                ]\r\n                            }\r\n                        },\r\n                        {\r\n                            \"url\": \"https://fhir.by/StructureDefinition/PatientConsentForNotification\",\r\n                            \"valueBoolean\": true\r\n                        }\r\n                    ]\r\n                }\r\n            ],\r\n            \"system\": \"phone\",\r\n            \"value\": \"+375291112233\"\r\n        }\r\n    ],\r\n    \"gender\": \"male\",\r\n    \"birthDate\": \"1990-12-31\",\r\n    \"deceasedBoolean\": false,\r\n    \"address\": [\r\n        {\r\n            \"extension\": [\r\n                {\r\n                    \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                    \"valueCodeableConcept\": {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                \"version\": \"1.51\",\r\n                                \"code\": \"BY\",\r\n                                \"display\": \"Беларусь\"\r\n                            }\r\n                        ]\r\n                    }\r\n                },\r\n                {\r\n                    \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                    \"valueCodeableConcept\": {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                \"version\": \"1.3\",\r\n                                \"code\": \"2938771891184418\"\r\n                            }\r\n                        ]\r\n                    }\r\n                },\r\n                {\r\n                    \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                    \"valueString\": \"кв. 101\"\r\n                }\r\n            ],\r\n            \"use\": \"home\",\r\n            \"text\": \"Витебская область, г. Витебск, Улица 19-я Городокская, д. 5\"\r\n        },\r\n        {\r\n            \"extension\": [\r\n                {\r\n                    \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                    \"valueCodeableConcept\": {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                \"version\": \"1.51\",\r\n                                \"code\": \"BY\",\r\n                                \"display\": \"Беларусь\"\r\n                            }\r\n                        ]\r\n                    }\r\n                },\r\n                {\r\n                    \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                    \"valueCodeableConcept\": {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                \"version\": \"1.3\",\r\n                                \"code\": \"12463236041049757\"\r\n                            }\r\n                        ]\r\n                    }\r\n                },\r\n                {\r\n                    \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                    \"valueString\": \"кв. 1201\"\r\n                }\r\n            ],\r\n            \"use\": \"temp\",\r\n            \"text\": \"Брестская область, г. Пинск, Улица Центральная, д. 9\"\r\n        }\r\n    ]\r\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "поиск пациента по идентификационному номеру",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "var jsonData = pm.response.json();\r\nlet patientId = jsonData.entry.find(obj => obj.resource.resourceType === \"Patient\").resource.id;\r\n\r\npm.collectionVariables.set(\"patientId\", patientId);\r\nconsole.log(patientId)\r\n"
                    ]
                  }
                }
              ],
              "protocolProfileBehavior": {
                "disableBodyPruning": true
              },
              "request": {
                "method": "GET",
                "header": [],
                "body": {
                  "mode": "raw",
                  "raw": "",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient?identifier=7551231A009PB1",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient"
                  ],
                  "query": [
                    {
                      "key": "identifier",
                      "value": "7551231A009PB1"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Метод получения идентификатора электронного документа",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "var jsonData = pm.response.json();\r\nlet identifier = jsonData.parameter.find(obj => obj.name === \"identifier\").valueString;\r\npm.collectionVariables.set(\"identifier\", identifier);\r\nconsole.log(identifier)"
                    ]
                  }
                }
              ],
              "request": {
                "method": "POST",
                "header": [],
                "body": {
                  "mode": "raw",
                  "raw": "{\r\n    \"resourceType\": \"Parameters\",\r\n    \"parameter\": [\r\n        {\r\n            \"name\": \"document-code\",\r\n            \"valueCoding\": {\r\n                \"system\": \"https://fhir.by/ValueSet/DigitalDocumentKind\",\r\n                \"code\": \"04\"\r\n            }\r\n        }\r\n    ]\r\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/$get-document-id",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "$get-document-id"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "импорт пакета медицинских данных",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Валидный бандл должен отработать со статусом 202\", function () {\r\n    pm.response.to.have.status(202);\r\n});\r\n\r\nvar jsonData = pm.response.json();\r\nlet bundleId = jsonData.parameter.find(obj => obj.name === \"ResourceId\").valueString;\r\nlet statusReference = jsonData.parameter.find(obj => obj.name === \"OperationStatusReference\");\r\n\r\nconsole.log(statusReference.valueReference.reference);\r\n\r\npm.collectionVariables.set(\"bundleId\", bundleId);\r\npm.collectionVariables.set(\"StatusUrl\", statusReference.valueReference.reference);\r\n"
                    ]
                  }
                }
              ],
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Fhir-By-Version",
                    "value": "active"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\r\n    \"resourceType\": \"Bundle\",\r\n    \"id\": \"BundleForTest\",\r\n    \"meta\": {\r\n        \"profile\": [\r\n            \"https://fhir.by/AbstractArea/StructureDefinition/Bundle/MedicationDocument\"\r\n        ]\r\n    },\r\n    \"identifier\": {\r\n        \"system\": \"https://fhir.by/ValueSet/urn:ietf:rfc:3986\",\r\n        \"value\": \"urn:uuid:0c3151bd-1cbf-4d64-b04d-{{$guid}}\"\r\n    },\r\n    \"type\": \"document\",\r\n    \"timestamp\": \"2024-04-07T11:30:00Z\",\r\n    \"entry\": [\r\n        {\r\n            \"fullUrl\": \"Composition/CompositionBundleForTest\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Composition\",\r\n                \"id\": \"{{$guid}}\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/CompDocument\"\r\n                    ]\r\n                },\r\n                \"status\": \"registered\",\r\n                \"type\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/CompositionType\",\r\n                            \"code\": \"general\",\r\n                            \"display\": \"Общая медицинская информация\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"subject\": [\r\n                    {\r\n                        \"reference\": \"Patient/PatientBundleForTest\"\r\n                    }\r\n                ],\r\n                \"date\": \"2024-04-07T11:12:21Z\",\r\n                \"author\": [\r\n                    {\r\n                        \"reference\": \"Practitioner/{{PractitionerMREC}}\"\r\n                    }\r\n                ],\r\n                \"title\": \"CompDocument для наполненного Bundle\",\r\n                \"custodian\": {\r\n                    \"reference\": \"Organization/{{OrganizationMREC}}\"\r\n                }\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Patient/PatientBundleForTest\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Patient\",\r\n                \"id\": \"ExamplePatientWithIdentificationNumber\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/PatientED\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/DocumentKind\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/DigitalDocumentKind\",\r\n                                    \"code\": \"00\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    }\r\n                ],\r\n                \"identifier\": [\r\n                    {\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/PersonalDocumentType\",\r\n                                    \"code\": \"INP\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"value\": \"7551231A009PB1\"\r\n                    }\r\n                ],\r\n                \"active\": true,\r\n                \"name\": [\r\n                    {\r\n                        \"family\": \"Иванов\",\r\n                        \"given\": [\r\n                            \"Петр\",\r\n                            \"Сидорович\"\r\n                        ]\r\n                    }\r\n                ],\r\n                \"birthDate\": \"1990-12-31\",\r\n                \"gender\": \"male\",\r\n                \"telecom\": [\r\n                    {\r\n                        \"system\": \"phone\",\r\n                        \"value\": \"+375291112233\"\r\n                    }\r\n                ],\r\n                \"address\": [\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                            \"version\": \"1.51\",\r\n                                            \"code\": \"BY\",\r\n                                            \"display\": \"Беларусь\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                            \"version\": \"1.3\",\r\n                                            \"code\": \"2938771891184418\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                                \"valueString\": \"кв. 101\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"home\",\r\n                        \"text\": \"Витебская область, г. Витебск, Улица 19-я Городокская, д. 5\"\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                            \"version\": \"1.51\",\r\n                                            \"code\": \"BY\",\r\n                                            \"display\": \"Беларусь\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                            \"version\": \"1.3\",\r\n                                            \"code\": \"12463236041049757\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                                \"valueString\": \"кв. 1201\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"temp\",\r\n                        \"text\": \"Брестская область, г. Пинск, Улица Центральная, д. 9\"\r\n                    }\r\n                ],\r\n                \"link\": [\r\n                    {\r\n                        \"other\": {\r\n                            \"reference\": \"Patient/{{patientId}}\"\r\n                        },\r\n                        \"type\": \"refer\"\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Encounter/EncounterBundleForTest\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Encounter\",\r\n                \"id\": \"ExampleEncounterForMREC\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/EncounterGeneral\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/EncouterMRECConcent\",\r\n                        \"valueBoolean\": true\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/DisabilityFirstTime\",\r\n                        \"valueBoolean\": true\r\n                    }\r\n                ],\r\n                \"identifier\": [\r\n                    {\r\n                        \"value\": \"1235\",\r\n                        \"assigner\": {\r\n                            \"reference\": \"Organization/{{OrganizationMREC}}\",\r\n                            \"display\": \"Учреждение здравоохранения \\\"Витебская областная медико-реабилитационная экспертная комиссия\\\"\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"status\": \"completed\",\r\n                \"class\": [\r\n                    {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/VSTermsOfService\",\r\n                                \"code\": \"1\"\r\n                            }\r\n                        ]\r\n                    }\r\n                ],\r\n                \"priority\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/HealthCareForms\",\r\n                            \"code\": \"planned\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"type\": [\r\n                    {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/TypeOfHealthCare\",\r\n                                \"code\": \"special\"\r\n                            }\r\n                        ]\r\n                    }\r\n                ],\r\n                \"subject\": {\r\n                    \"reference\": \"Patient/{{patientId}}\",\r\n                    \"display\": \"Иванова Лариса Ивановна\"\r\n                },\r\n                \"serviceProvider\": {\r\n                    \"reference\": \"Organization/{{OrganizationMREC}}\"\r\n                },\r\n                \"actualPeriod\": {\r\n                    \"start\": \"2026-09-15T10:10:21Z\",\r\n                    \"end\": \"2026-09-15T12:00:21Z\"\r\n                },\r\n                \"participant\": [\r\n                    {\r\n                        \"actor\": {\r\n                            \"reference\": \"PractitionerRole/{{PractitionerRoleMREC}}\",\r\n                            \"display\": \"Иванов Владислав Эдуардович\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"diagnosis\": [\r\n                    {\r\n                        \"condition\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"Condition/ExampleDiagnosisMREC\"\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"use\": [\r\n                            {\r\n                                \"coding\": [\r\n                                    {\r\n                                        \"system\": \"https://fhir.by/ValueSet/TypeOfDiagnosis\",\r\n                                        \"code\": \"mainDiagnosis\"\r\n                                    }\r\n                                ]\r\n                            }\r\n                        ]\r\n                    }\r\n                ],\r\n                \"location\": [\r\n                    {\r\n                        \"location\": {\r\n                            \"reference\": \"Location/{{LocationMREC}}\"\r\n                        }\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Condition/ExampleDiagnosisMREC\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Condition\",\r\n                \"id\": \"ExampleDiagnosisMREC\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/FinalDiagnosis\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/KindOfDiagnosis\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/KindOfDiagnosisCode\",\r\n                                    \"code\": \"Сlinical-functional\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/AssertedDate\",\r\n                        \"valueDateTime\": \"2024-09-01\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/FirstTimeRevealed\",\r\n                        \"valueBoolean\": true\r\n                    }\r\n                ],\r\n                \"clinicalStatus\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"http://terminology.hl7.org/CodeSystem/condition-clinical\",\r\n                            \"code\": \"active\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"code\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/InternClassificDiseases10\",\r\n                            \"code\": \"M16.6\",\r\n                            \"display\": \"M16.6 - Другие вторичные коксартрозы двусторонние\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"subject\": {\r\n                    \"reference\": \"Patient/{{patientId}}\"\r\n                },\r\n                \"onsetDateTime\": \"2024-09-01\",\r\n                \"recordedDate\": \"2024-09-01\",\r\n                \"participant\": [\r\n                    {\r\n                        \"actor\": {\r\n                            \"reference\": \"PractitionerRole/{{PractitionerRoleMREC}}\",\r\n                            \"display\": \"Иванов Владислав Эдуардович\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"note\": [\r\n                    {\r\n                        \"text\": \"Двусторонний диспластический коксартроз 3 ст., ФК III справа, ФК IV слева\"\r\n                    }\r\n                ]\r\n            }\r\n        }\r\n    ]\r\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Bundle/$import",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Bundle",
                    "$import"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "получение статуса импорта пакета медицинских данных",
              "request": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Bundle/{{bundleId}}/$status",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Bundle",
                    "{{bundleId}}",
                    "$status"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "поиск пациента по идентификационному номеру",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "var jsonData = pm.response.json();\r\nlet patientId = jsonData.entry.find(obj => obj.resource.resourceType === \"Patient\").resource.id;\r\n\r\npm.collectionVariables.set(\"patientId\", patientId);\r\nconsole.log(patientId)\r\n"
                    ]
                  }
                }
              ],
              "protocolProfileBehavior": {
                "disableBodyPruning": true
              },
              "request": {
                "method": "GET",
                "header": [],
                "body": {
                  "mode": "raw",
                  "raw": "",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient?identifier=7551231A009PB1",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient"
                  ],
                  "query": [
                    {
                      "key": "identifier",
                      "value": "7551231A009PB1"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Поиск обращения пациента к врачу",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "var jsonData = pm.response.json();\r",
                      "\r",
                      "// Фильтруем только Encounter ресурсы, исключая OperationOutcome\r",
                      "let encounterEntries = jsonData.entry.filter(entry => \r",
                      "    entry.resource && entry.resource.resourceType === \"Encounter\"\r",
                      ");\r",
                      "\r",
                      "if (encounterEntries.length > 0) {\r",
                      "    // Сортируем по дате lastUpdated (от новых к старым) и берем самый свежий\r",
                      "    encounterEntries.sort((a, b) => \r",
                      "        new Date(b.resource.meta.lastUpdated) - new Date(a.resource.meta.lastUpdated)\r",
                      "    );\r",
                      "    \r",
                      "    let latestEncounter = encounterEntries[0];\r",
                      "    let encounterId = latestEncounter.resource.id;\r",
                      "    pm.collectionVariables.set(\"encounterId\", encounterId);\r",
                      "    console.log(\"Latest encounterId:\", encounterId);\r",
                      "    console.log(\"Last updated:\", latestEncounter.resource.meta.lastUpdated);\r",
                      "} else {\r",
                      "    console.log(\"No Encounter resources found in response\");\r",
                      "}"
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "protocolProfileBehavior": {
                "disableBodyPruning": true
              },
              "request": {
                "method": "GET",
                "header": [],
                "body": {
                  "mode": "raw",
                  "raw": "",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient/{{patientId}}/Encounter?_profile=https://fhir.by/StructureDefinition/EncounterGeneral&patient={{patientId}}&_sort=-_lastUpdated",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient",
                    "{{patientId}}",
                    "Encounter"
                  ],
                  "query": [
                    {
                      "key": "_profile",
                      "value": "https://fhir.by/StructureDefinition/EncounterGeneral"
                    },
                    {
                      "key": "patient",
                      "value": "{{patientId}}"
                    },
                    {
                      "key": "_sort",
                      "value": "-_lastUpdated"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Поиск диагноза пациента к врачу",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "var jsonData = pm.response.json();\r",
                      "let conditionId = jsonData.entry.find(obj => obj.resource.resourceType === \"Condition\").resource.id;\r",
                      "\r",
                      "pm.collectionVariables.set(\"conditionId\", conditionId);\r",
                      "console.log(conditionId)\r",
                      ""
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "protocolProfileBehavior": {
                "disableBodyPruning": true
              },
              "request": {
                "method": "GET",
                "header": [],
                "body": {
                  "mode": "raw",
                  "raw": "",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient/{{patientId}}/Condition?_profile=https://fhir.by/StructureDefinition/FinalDiagnosis&_sort=-_lastUpdated",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient",
                    "{{patientId}}",
                    "Condition"
                  ],
                  "query": [
                    {
                      "key": "_profile",
                      "value": "https://fhir.by/StructureDefinition/FinalDiagnosis"
                    },
                    {
                      "key": "_sort",
                      "value": "-_lastUpdated"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Метод проверки отсутствия у пациента актуальных заключений МРЭК",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      ""
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "request": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient/{{patientId}}/ClinicalImpression?_profile=https://fhir.by/StructureDefinition/ConclusionMREC&status=completed",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient",
                    "{{patientId}}",
                    "ClinicalImpression"
                  ],
                  "query": [
                    {
                      "key": "_profile",
                      "value": "https://fhir.by/StructureDefinition/ConclusionMREC"
                    },
                    {
                      "key": "status",
                      "value": "completed"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Метод проверка отсутствия у пациента актуальных индивидуальных программ реабилитации",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      ""
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "protocolProfileBehavior": {
                "disableBodyPruning": true
              },
              "request": {
                "method": "GET",
                "header": [],
                "body": {
                  "mode": "raw",
                  "raw": "",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient/{{patientId}}/CarePlan?_profile=https://fhir.by/StructureDefinition/IPR&status=active",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient",
                    "{{patientId}}",
                    "CarePlan"
                  ],
                  "query": [
                    {
                      "key": "_profile",
                      "value": "https://fhir.by/StructureDefinition/IPR"
                    },
                    {
                      "key": "status",
                      "value": "active"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Метод импорта пакета медицинской информации (заключение МРЭК)",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "pm.test(\"Валидный бандл должен отработать со статусом 202\", function () {\r",
                      "    pm.response.to.have.status(202);\r",
                      "});\r",
                      "\r",
                      "var jsonData = pm.response.json();\r",
                      "let bundleId = jsonData.parameter.find(obj => obj.name === \"ResourceId\").valueString;\r",
                      "let statusReference = jsonData.parameter.find(obj => obj.name === \"OperationStatusReference\");\r",
                      "\r",
                      "console.log(statusReference.valueReference.reference);\r",
                      "\r",
                      "pm.collectionVariables.set(\"bundleId\", bundleId);\r",
                      "pm.collectionVariables.set(\"StatusUrl\", statusReference.valueReference.reference);\r",
                      ""
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Fhir-By-Version",
                    "value": "active",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\r\n    \"resourceType\": \"Bundle\",\r\n    \"id\": \"BundleConclusionMRECDisability190110\",\r\n    \"meta\": {\r\n        \"profile\": [\r\n            \"https://fhir.by/AbstractArea/StructureDefinition/Bundle/BundleMREC\"\r\n        ]\r\n    },\r\n    \"identifier\": {\r\n        \"system\": \"https://minzdrav.gov.by\",\r\n        \"value\": \"{{identifier}}\"\r\n    },\r\n    \"type\": \"document\",\r\n    \"timestamp\": \"2024-09-01T11:12:21Z\",\r\n    \"entry\": [\r\n        {\r\n            \"fullUrl\": \"Composition/ExampleCompositionMRECDisability\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Composition\",\r\n                \"id\": \"ExampleCompositionMRECDisability\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/DocumentMREC\"\r\n                    ]\r\n                },\r\n                \"status\": \"final\",\r\n                \"type\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/CompositionType\",\r\n                            \"code\": \"conclusion-mrec\",\r\n                            \"display\": \"Заключение МРЭК\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"subject\": [\r\n                    {\r\n                        \"reference\": \"Patient/ExamplePatientWithIdentificationNumber\"\r\n                    }\r\n                ],\r\n                \"date\": \"2024-09-01T11:12:21Z\",\r\n                \"author\": [\r\n                    {\r\n                        \"reference\": \"Practitioner/{{PractitionerMREC}}\"\r\n                    }\r\n                ],\r\n                \"title\": \"Уточненный состав необходимых данных о лице, предоставляемых медико-реабилитационными экспертными комиссиями\",\r\n                \"custodian\": {\r\n                    \"reference\": \"Organization/{{OrganizationMREC}}\"\r\n                },\r\n                \"event\": [\r\n                    {\r\n                        \"detail\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"ClinicalImpression/ExampleConclusionMREC\"\r\n                                }\r\n                            }\r\n                        ]\r\n                    },\r\n                    {\r\n                        \"detail\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"CarePlan/ExampleIPR\"\r\n                                }\r\n                            }\r\n                        ]\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Patient/ExamplePatientWithIdentificationNumber\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Patient\",\r\n                \"id\": \"ExamplePatientWithIdentificationNumber\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/PatientED\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/DocumentKind\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/DigitalDocumentKind\",\r\n                                    \"code\": \"04\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    }\r\n                ],\r\n                \"identifier\": [\r\n                    {\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/PersonalDocumentType\",\r\n                                    \"code\": \"INP\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"value\": \"7551231A009PB1\"\r\n                    }\r\n                ],\r\n                \"active\": true,\r\n                \"name\": [\r\n                    {\r\n                        \"family\": \"Иванов\",\r\n                        \"given\": [\r\n                            \"Петр\",\r\n                            \"Сидорович\"\r\n                        ]\r\n                    }\r\n                ],\r\n                \"birthDate\": \"1990-12-31\",\r\n                \"telecom\": [\r\n                    {\r\n                        \"system\": \"phone\",\r\n                        \"value\": \"+375291112233\"\r\n                    }\r\n                ],\r\n                \"address\": [\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                            \"version\": \"1.51\",\r\n                                            \"code\": \"BY\",\r\n                                            \"display\": \"Беларусь\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                            \"version\": \"1.3\",\r\n                                            \"code\": \"2938771891184418\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                                \"valueString\": \"кв. 101\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"home\",\r\n                        \"text\": \"Витебская область, г. Витебск, Улица 19-я Городокская, д. 5\"\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                            \"version\": \"1.51\",\r\n                                            \"code\": \"BY\",\r\n                                            \"display\": \"Беларусь\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                            \"version\": \"1.3\",\r\n                                            \"code\": \"12463236041049757\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                                \"valueString\": \"кв. 1201\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"temp\",\r\n                        \"text\": \"Брестская область, г. Пинск, Улица Центральная, д. 9\"\r\n                    }\r\n                ],\r\n                \"link\": [\r\n                    {\r\n                        \"other\": {\r\n                            \"reference\": \"Patient/{{patientId}}\"\r\n                        },\r\n                        \"type\": \"refer\"\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"ClinicalImpression/ExampleConclusionMREC\",\r\n            \"resource\": {\r\n                \"resourceType\": \"ClinicalImpression\",\r\n                \"id\": \"ExampleConclusionMREC\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/ConclusionMREC\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CodesReasonForMREC\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/ReasonForMREC\",\r\n                                            \"code\": \"definition-disability\",\r\n                                            \"display\": \"освидетельствование  пациента\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"url\": \"https://fhir.by/StructureDefinition/ReasonForMREC\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/ExtSurveyTypeMREC\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/SurveyTypeMREC\",\r\n                                    \"code\": \"1\",\r\n                                    \"display\": \"первичное очное\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/LossOfProfessionalAbilityPercentage\",\r\n                                \"valueQuantity\": {\r\n                                    \"value\": 25,\r\n                                    \"unit\": \"%\",\r\n                                    \"system\": \"https://fhir.by/ValueSet/UnitsOfMeasureBy\"\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/LossOfProfessionalAbilityCase\",\r\n                                \"valueString\": \"Страховой случай, его дата, документ, послуживший основанием для установления степени утраты профессиональной трудоспособности\"\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/LossOfProfessionalAbilityTerm\",\r\n                                \"valuePeriod\": {\r\n                                    \"start\": \"2024-09-20\",\r\n                                    \"end\": \"2025-09-20\"\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"url\": \"https://fhir.by/StructureDefinition/LossOfProfessionalAbility\"\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ContraindicatedFactors\",\r\n                                \"valueString\": \"Противопоказанные факторы производственной среды, тяжесть и напряженность трудового процесса, виды работ\"\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/IndicatedFactors\",\r\n                                \"valueString\": \"Показанные условия труда и режим рабочего времени\"\r\n                            }\r\n                        ],\r\n                        \"url\": \"https://fhir.by/StructureDefinition/RequirementsForWorking\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/DisabilityCertificate\",\r\n                        \"valueIdentifier\": {\r\n                            \"value\": \"15№ 0003839\",\r\n                            \"period\": {\r\n                                \"start\": \"2024-09-20\",\r\n                                \"end\": \"2025-09-20\"\r\n                            },\r\n                            \"assigner\": {\r\n                                \"reference\": \"Organization/{{OrganizationMREC}}\"\r\n                            }\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/DisabilityGroup\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/DisabilityGroup\",\r\n                                    \"code\": \"2_group\",\r\n                                    \"display\": \"II группа\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/DisabilityReason\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/DisabilityReason\",\r\n                                    \"code\": \"general\",\r\n                                    \"display\": \"общее заболевание\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/AdditionalTypesOfHelp\",\r\n                        \"valueString\": \"не нуждается в постоянной помощи\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/AdditionalTypesOfCare\",\r\n                        \"valueString\": \"не нуждается в постоянном уходе\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/AdditionalForConclusionMREC\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/AdditionalForConclusionMREC\",\r\n                                    \"code\": \"absens\",\r\n                                    \"display\": \"отсутствует\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/ProgramRehabilitionMREC\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/ProgramRehabilitionMREC\",\r\n                                    \"code\": \"ipra\",\r\n                                    \"display\": \"индивидуальная программа реабилитации, абилитации инвалида\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    }\r\n                ],\r\n                \"encounter\": {\r\n                    \"reference\": \"Encounter/{{encounterId}}\"\r\n                },\r\n                \"identifier\": [\r\n                    {\r\n                        \"value\": \"{{identifier}}\",\r\n                        \"period\": {\r\n                            \"start\": \"2024-09-20\",\r\n                            \"end\": \"2025-09-20\"\r\n                        },\r\n                        \"assigner\": {\r\n                            \"extension\": [\r\n                                {\r\n                                    \"url\": \"https://fhir.by/StructureDefinition/LocationReference\",\r\n                                    \"valueReference\": {\r\n                                        \"reference\": \"Location/{{LocationMREC}}\"\r\n                                    }\r\n                                }\r\n                            ],\r\n                            \"reference\": \"Organization/{{OrganizationMREC}}\",\r\n                            \"display\": \"{{OrganizationName}}\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"status\": \"completed\",\r\n                \"description\": \"Заключение МРЭК №{{identifier}}, Иванова Лариса Ивановна, 31.12.1990\",\r\n                \"subject\": {\r\n                    \"reference\": \"Patient/ExamplePatientWithIdentificationNumber\"\r\n                },\r\n                \"effectiveDateTime\": \"2026-09-25\",\r\n                // \"effectivePeriod\": {\r\n                //     \"start\": \"2026-07-29\",\r\n                //     \"end\": \"2026-07-30\"\r\n                // },\r\n                \"date\": \"2026-09-20\",\r\n                \"performer\": {\r\n                    \"reference\": \"PractitionerRole/{{PractitionerRoleMREC}}\"\r\n                }\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"CarePlan/ExampleIPR\",\r\n            \"resource\": {\r\n                \"resourceType\": \"CarePlan\",\r\n                \"id\": \"ExampleIPR\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/IPR\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/AdditionalForConclusionMREC\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/AdditionalForConclusionMREC\",\r\n                                    \"code\": \"absens\",\r\n                                    \"display\": \"отсутствует\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ContraindicatedFactors\",\r\n                                \"valueString\": \"Противопоказанные факторы производственной среды, тяжесть и напряженность трудового процесса, виды работ\"\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/IndicatedFactors\",\r\n                                \"valueString\": \"Показанные условия труда и режим рабочего времени\"\r\n                            }\r\n                        ],\r\n                        \"url\": \"https://fhir.by/StructureDefinition/RequirementsForWorking\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/ReferredInitially\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/RehabProgramm\",\r\n                                    \"code\": \"first\",\r\n                                    \"display\": \"впервые\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/ReferenceToConclusionMREC\",\r\n                        \"valueReference\": {\r\n                            \"reference\": \"ClinicalImpression/ExampleConclusionMREC\"\r\n                        }\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/DisorderCode\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/DisordersFunctionAndSystem\",\r\n                                            \"code\": \"handdisf\",\r\n                                            \"display\": \"нарушение функции хвата и удержания кисти, манипуляционной функции кисти\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/DisorderGrade\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/DegreesOfManifestationOfDisfunctions\",\r\n                                            \"code\": \"light\",\r\n                                            \"display\": \"легкие\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"url\": \"https://fhir.by/StructureDefinition/ExtDisordersFunctionAndSystem\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/SpecialtyMREC\",\r\n                        \"valueString\": \"Токарь-расточник\"\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/PatientStudyKind\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/EducationKind\",\r\n                                            \"code\": \"student\",\r\n                                            \"display\": \"студент дневной формы обучения\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/PatientStudyPlace\",\r\n                                \"valueString\": \"Наименование и адрес учреждения образования или номер и адрес учреждения дошкольного образования\"\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/PatientTermOfStudy\",\r\n                                \"valuePeriod\": {\r\n                                    \"start\": \"2024-01-05\"\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"url\": \"https://fhir.by/StructureDefinition/PatientStudy\"\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/PatientJobProfession\",\r\n                                \"valueString\": \"Токарь\"\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/PatientJobProfessionCode\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/SpecialtyProfPerson\",\r\n                                            \"code\": \"7223-086\",\r\n                                            \"display\": \"Облицовщик-плиточник\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/PatientJobPlace\",\r\n                                \"valueString\": \"ИП\"\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/TermOFWork\",\r\n                                \"valuePeriod\": {\r\n                                    \"start\": \"2024-09-01\"\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/MainJobPlace\",\r\n                                \"valueBoolean\": true\r\n                            }\r\n                        ],\r\n                        \"url\": \"https://fhir.by/StructureDefinition/PatientJob\"\r\n                    }\r\n                ],\r\n                \"identifier\": [\r\n                    {\r\n                        \"value\": \"{{identifier}}\",\r\n                        \"assigner\": {\r\n                            \"extension\": [\r\n                                {\r\n                                    \"url\": \"https://fhir.by/StructureDefinition/LocationReference\",\r\n                                    \"valueReference\": {\r\n                                        \"reference\": \"Location/{{LocationMREC}}\"\r\n                                    }\r\n                                }\r\n                            ],\r\n                            \"reference\": \"Organization/{{OrganizationMREC}}\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"period\": {\r\n                    \"start\": \"2024-09-20\",\r\n                    \"end\": \"2025-09-20\"\r\n                },\r\n                \"basedOn\": [\r\n                    {\r\n                        \"identifier\": {\r\n                            \"value\": \"{{identifier}}\",\r\n                            \"period\": {\r\n                                \"start\": \"2024-09-20\"\r\n                            }\r\n                        }\r\n                    }\r\n                ],\r\n                \"status\": \"active\",\r\n                \"intent\": \"plan\",\r\n                \"title\": \"Программа реабилитации инвалида\",\r\n                \"subject\": {\r\n                    \"reference\": \"Patient/ExamplePatientWithIdentificationNumber\"\r\n                },\r\n                \"created\": \"2024-09-20\",\r\n                \"custodian\": {\r\n                    \"reference\": \"Organization/{{OrganizationMREC}}\"\r\n                },\r\n                \"contributor\": [\r\n                    {\r\n                        \"reference\": \"PractitionerRole/{{PractitionerRoleMREC}}\",\r\n                        \"display\": \"Председатель МРЭК\"\r\n                    }\r\n                ],\r\n                \"addresses\": [\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ActivitiesLoss\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/FunctionalClass\",\r\n                                            \"code\": \"2\",\r\n                                            \"display\": \"Функциональный класс II\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"concept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/RestrictCategoriesActivity\",\r\n                                    \"code\": \"abletoselfcare\",\r\n                                    \"display\": \"Способность к самообслуживанию.\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ActivitiesLoss\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/FunctionalClass\",\r\n                                            \"code\": \"3\",\r\n                                            \"display\": \"Функциональный класс III.\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"concept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/RestrictCategoriesActivity\",\r\n                                    \"code\": \"abletoorientate\",\r\n                                    \"display\": \"Способность к ориентации.\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    }\r\n                ],\r\n                \"activity\": [\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"extension\": [\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/MedicalRehabilitationEventCode\",\r\n                                        \"valueCodeableConcept\": {\r\n                                            \"coding\": [\r\n                                                {\r\n                                                    \"system\": \"https://fhir.by/ValueSet/RehubActivities\",\r\n                                                    \"code\": \"complex\",\r\n                                                    \"display\": \"Физиотерапия\"\r\n                                                }\r\n                                            ]\r\n                                        }\r\n                                    },\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/RehabilitationEventNeediness\",\r\n                                        \"valueCodeableConcept\": {\r\n                                            \"coding\": [\r\n                                                {\r\n                                                    \"system\": \"https://fhir.by/ValueSet/Neediness\",\r\n                                                    \"code\": \"need\",\r\n                                                    \"display\": \"нуждается\"\r\n                                                }\r\n                                            ]\r\n                                        }\r\n                                    },\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/RehabilitationEventString\",\r\n                                        \"valueString\": \"Магнитотерапия на всё\"\r\n                                    },\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/RehabilitationEventPeriod\",\r\n                                        \"valuePeriod\": {\r\n                                            \"start\": \"2024-01-05\"\r\n                                        }\r\n                                    }\r\n                                ],\r\n                                \"url\": \"https://fhir.by/StructureDefinition/MedicalRehabilitationEvent\"\r\n                            }\r\n                        ],\r\n                        \"progress\": [\r\n                            {\r\n                                \"text\": \"Поликлиника №15 в течение месяца \"\r\n                            }\r\n                        ]\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"extension\": [\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/SocialRehabilitationEventCode\",\r\n                                        \"valueCodeableConcept\": {\r\n                                            \"coding\": [\r\n                                                {\r\n                                                    \"system\": \"https://fhir.by/ValueSet/SocRehab\",\r\n                                                    \"code\": \"psychohelp\",\r\n                                                    \"display\": \"Психологическая помощь\"\r\n                                                }\r\n                                            ]\r\n                                        }\r\n                                    },\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/RehabilitationEventNeediness\",\r\n                                        \"valueCodeableConcept\": {\r\n                                            \"coding\": [\r\n                                                {\r\n                                                    \"system\": \"https://fhir.by/ValueSet/Neediness\",\r\n                                                    \"code\": \"need\",\r\n                                                    \"display\": \"нуждается\"\r\n                                                }\r\n                                            ]\r\n                                        }\r\n                                    },\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/RehabilitationEventString\",\r\n                                        \"valueString\": \"Другие методы реабилитации или ТССР\"\r\n                                    },\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/RehabilitationEventPeriod\",\r\n                                        \"valuePeriod\": {\r\n                                            \"start\": \"2024-09-20\"\r\n                                        }\r\n                                    }\r\n                                ],\r\n                                \"url\": \"https://fhir.by/StructureDefinition/SocialRehabilitationEvent\"\r\n                            }\r\n                        ],\r\n                        \"progress\": [\r\n                            {\r\n                                \"text\": \"ВОП Иванов ИИ - молодец\"\r\n                            }\r\n                        ]\r\n                    }\r\n                ],\r\n                \"note\": [\r\n                    {\r\n                        \"text\": \"Текстовое содержимое аннотации\"\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Provenance/ExampleProvenanceDocumentInfoMRECDisability\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Provenance\",\r\n                \"id\": \"ExampleProvenanceDocumentInfoMRECDisability\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/ProvenanceDocumentInfoMREC\"\r\n                    ]\r\n                },\r\n                \"target\": [\r\n                    {\r\n                        \"reference\": \"Patient/ExamplePatientWithIdentificationNumber\"\r\n                    }\r\n                ],\r\n                \"recorded\": \"2024-09-20T11:12:21Z\",\r\n                \"location\": {\r\n                    \"extension\": [\r\n                        {\r\n                            \"url\": \"https://fhir.by/StructureDefinition/ExtStringValue\",\r\n                            \"valueString\": \"{{codeMrecLocation}}\"\r\n                        }\r\n                    ],\r\n                    \"reference\": \"Location/{{LocationMREC}}\",\r\n                    \"display\": \"{{LocationName}}\"\r\n                },\r\n                \"authorization\": [\r\n                    {\r\n                        \"reference\": {\r\n                            \"reference\": \"ClinicalImpression/ExampleConclusionMREC\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"patient\": {\r\n                    \"reference\": \"Patient/ExamplePatientWithIdentificationNumber\"\r\n                },\r\n                \"agent\": [\r\n                    {\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/AgentTypeProvenance\",\r\n                                    \"code\": \"organization\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"who\": {\r\n                            \"extension\": [\r\n                                {\r\n                                    \"url\": \"https://fhir.by/StructureDefinition/ExtStringValue\",\r\n                                    \"valueString\": \"{{codeMREC}}\"\r\n                                }\r\n                            ],\r\n                            \"reference\": \"Organization/{{OrganizationMREC}}\",\r\n                            \"display\": \"{{OrganizationName}}\"\r\n                        }\r\n                    },\r\n                    {\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/AgentTypeProvenance\",\r\n                                    \"code\": \"practitioner\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"who\": {\r\n                            \"reference\": \"Practitioner/{{PractitionerMREC}}\",\r\n                            \"display\": \"{{PractitionerName}}\"\r\n                        }\r\n                    },\r\n                    {\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/AgentTypeProvenance\",\r\n                                    \"code\": \"practitionerRole\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"who\": {\r\n                            \"reference\": \"PractitionerRole/{{PractitionerRoleMREC}}\",\r\n                            \"display\": \"{{PractitionerRoleName}}\"\r\n                        }\r\n                    }\r\n                ]\r\n            }\r\n        }\r\n    ]\r\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Bundle/$import",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Bundle",
                    "$import"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Метод получения статуса операции импорта пакета медицинской информации",
              "request": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Bundle/{{bundleId}}/$status",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Bundle",
                    "{{bundleId}}",
                    "$status"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Метод проверки наличия у пациента актуальных заключений МРЭК",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "var jsonData = pm.response.json();\r",
                      "let patientId = jsonData.entry.find(obj => obj.resource.resourceType === \"ClinicalImpression\").resource.id;\r",
                      "\r",
                      "pm.collectionVariables.set(\"clinicalImpressionId\", patientId);\r",
                      "console.log(patientId)\r",
                      ""
                    ],
                    "type": "text/javascript",
                    "packages": {}
                  }
                }
              ],
              "request": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient/{{patientId}}/ClinicalImpression?_profile=https://fhir.by/StructureDefinition/ConclusionMREC&status=completed",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient",
                    "{{patientId}}",
                    "ClinicalImpression"
                  ],
                  "query": [
                    {
                      "key": "_profile",
                      "value": "https://fhir.by/StructureDefinition/ConclusionMREC"
                    },
                    {
                      "key": "status",
                      "value": "completed"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Метод проверка наличия у пациента актуальных индивидуальных программ реабилитации",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "var jsonData = pm.response.json();\r",
                      "let patientId = jsonData.entry.find(obj => obj.resource.resourceType === \"CarePlan\").resource.id;\r",
                      "\r",
                      "pm.collectionVariables.set(\"carePlanId\", patientId);\r",
                      "console.log(patientId)\r",
                      ""
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "protocolProfileBehavior": {
                "disableBodyPruning": true
              },
              "request": {
                "method": "GET",
                "header": [],
                "body": {
                  "mode": "raw",
                  "raw": "",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient/{{patientId}}/CarePlan?_profile=https://fhir.by/StructureDefinition/IPR&status=active",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient",
                    "{{patientId}}",
                    "CarePlan"
                  ],
                  "query": [
                    {
                      "key": "_profile",
                      "value": "https://fhir.by/StructureDefinition/IPR"
                    },
                    {
                      "key": "status",
                      "value": "active"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Поиск Provenance",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "var jsonData = pm.response.json();\r",
                      "let patientId = jsonData.entry.find(obj => obj.resource.resourceType === \"CarePlan\").resource.id;\r",
                      "\r",
                      "pm.collectionVariables.set(\"carePlanId\", patientId);\r",
                      "console.log(patientId)\r",
                      ""
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "protocolProfileBehavior": {
                "disableBodyPruning": true
              },
              "request": {
                "method": "GET",
                "header": [],
                "body": {
                  "mode": "raw",
                  "raw": "",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient/{{patientId}}/Provenance?_profile=https://fhir.by/StructureDefinition/ProvenanceDocumentInfoMREC&_sort=-_lastUpdated",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient",
                    "{{patientId}}",
                    "Provenance"
                  ],
                  "query": [
                    {
                      "key": "_profile",
                      "value": "https://fhir.by/StructureDefinition/ProvenanceDocumentInfoMREC"
                    },
                    {
                      "key": "_sort",
                      "value": "-_lastUpdated"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "сводная информация",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "var jsonData = pm.response.json();\r",
                      "let patientId = jsonData.entry.find(obj => obj.resource.resourceType === \"CarePlan\").resource.id;\r",
                      "\r",
                      "pm.collectionVariables.set(\"carePlanId\", patientId);\r",
                      "console.log(patientId)\r",
                      ""
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "protocolProfileBehavior": {
                "disableBodyPruning": true
              },
              "request": {
                "method": "GET",
                "header": [],
                "body": {
                  "mode": "raw",
                  "raw": "",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient/{{patientId}}/$everything?start=2026-06&end=2026-07",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient",
                    "{{patientId}}",
                    "$everything"
                  ],
                  "query": [
                    {
                      "key": "start",
                      "value": "2026-06"
                    },
                    {
                      "key": "end",
                      "value": "2026-07"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "get-bundle",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "var jsonData = pm.response.json();\r",
                      "let patientId = jsonData.entry.find(obj => obj.resource.resourceType === \"CarePlan\").resource.id;\r",
                      "\r",
                      "pm.collectionVariables.set(\"carePlanId\", patientId);\r",
                      "console.log(patientId)\r",
                      ""
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "protocolProfileBehavior": {
                "disableBodyPruning": true
              },
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "Accept",
                    "value": "text/html",
                    "type": "text",
                    "disabled": true
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Bundle/$get-bundle?identifier={{identifier}}",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Bundle",
                    "$get-bundle"
                  ],
                  "query": [
                    {
                      "key": "identifier",
                      "value": "{{identifier}}"
                    }
                  ]
                }
              },
              "response": []
            }
          ],
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "packages": {},
                "requests": {},
                "exec": [
                  ""
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "packages": {},
                "requests": {},
                "exec": [
                  ""
                ]
              }
            }
          ]
        },
        {
          "name": "Кейс 2. Пациент направлен на медико-социальную экспертизу для переосвидетельствования.  Группа инвалидности подтверждена. Сформирована индивидуальная программа реабилитации инвалида.",
          "item": [
            {
              "name": "поиск пациента по идентификационному номеру",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "var jsonData = pm.response.json();\r",
                      "let patientId = jsonData.entry.find(obj => obj.resource.resourceType === \"Patient\").resource.id;\r",
                      "\r",
                      "pm.collectionVariables.set(\"patientId\", patientId);\r",
                      "console.log(patientId)\r",
                      ""
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "protocolProfileBehavior": {
                "disableBodyPruning": true
              },
              "request": {
                "method": "GET",
                "header": [],
                "body": {
                  "mode": "raw",
                  "raw": "",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient?identifier=7551231A009PB1",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient"
                  ],
                  "query": [
                    {
                      "key": "identifier",
                      "value": "7551231A009PB1"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Метод проверки наличия у пациента актуальных заключений МРЭК",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "var jsonData = pm.response.json();\r",
                      "let patientId = jsonData.entry.find(obj => obj.resource.resourceType === \"ClinicalImpression\").resource.id;\r",
                      "\r",
                      "pm.collectionVariables.set(\"clinicalImpressionId\", patientId);\r",
                      "console.log(patientId)\r",
                      ""
                    ],
                    "type": "text/javascript",
                    "packages": {}
                  }
                }
              ],
              "request": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient/{{patientId}}/ClinicalImpression?_profile=https://fhir.by/StructureDefinition/ConclusionMREC&status=completed",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient",
                    "{{patientId}}",
                    "ClinicalImpression"
                  ],
                  "query": [
                    {
                      "key": "_profile",
                      "value": "https://fhir.by/StructureDefinition/ConclusionMREC"
                    },
                    {
                      "key": "status",
                      "value": "completed"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Метод проверка наличия у пациента актуальных индивидуальных программ реабилитации",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "var jsonData = pm.response.json();\r",
                      "let patientId = jsonData.entry.find(obj => obj.resource.resourceType === \"CarePlan\").resource.id;\r",
                      "\r",
                      "pm.collectionVariables.set(\"carePlanId\", patientId);\r",
                      "console.log(patientId)\r",
                      ""
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "protocolProfileBehavior": {
                "disableBodyPruning": true
              },
              "request": {
                "method": "GET",
                "header": [],
                "body": {
                  "mode": "raw",
                  "raw": "",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient/{{patientId}}/CarePlan?_profile=https://fhir.by/StructureDefinition/IPR&status=active",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient",
                    "{{patientId}}",
                    "CarePlan"
                  ],
                  "query": [
                    {
                      "key": "_profile",
                      "value": "https://fhir.by/StructureDefinition/IPR"
                    },
                    {
                      "key": "status",
                      "value": "active"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Метод получения идентификатора электронного документа",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "var jsonData = pm.response.json();\r",
                      "let identifier = jsonData.parameter.find(obj => obj.name === \"identifier\").valueString;\r",
                      "pm.collectionVariables.set(\"identifier\", identifier);\r",
                      "console.log(identifier)"
                    ],
                    "type": "text/javascript",
                    "packages": {}
                  }
                }
              ],
              "request": {
                "method": "POST",
                "header": [],
                "body": {
                  "mode": "raw",
                  "raw": "{\r\n\"resourceType\" : \"Parameters\",\r\n\"parameter\" : [{\r\n    \"name\" : \"document-code\",\r\n    \"valueCoding\" : {\r\n        \"system\": \"https://fhir.by/ValueSet/DigitalDocumentKind\",\r\n        \"code\": \"04\"\r\n    }\r\n}]\r\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/$get-document-id",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "$get-document-id"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "импорт пакета медицинских данных",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Валидный бандл должен отработать со статусом 202\", function () {\r\n    pm.response.to.have.status(202);\r\n});\r\n\r\nvar jsonData = pm.response.json();\r\nlet bundleId = jsonData.parameter.find(obj => obj.name === \"ResourceId\").valueString;\r\nlet statusReference = jsonData.parameter.find(obj => obj.name === \"OperationStatusReference\");\r\n\r\nconsole.log(statusReference.valueReference.reference);\r\n\r\npm.collectionVariables.set(\"bundleId\", bundleId);\r\npm.collectionVariables.set(\"StatusUrl\", statusReference.valueReference.reference);\r\n"
                    ]
                  }
                }
              ],
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Fhir-By-Version",
                    "value": "active"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\r\n    \"resourceType\": \"Bundle\",\r\n    \"id\": \"BundleForTest\",\r\n    \"meta\": {\r\n        \"profile\": [\r\n            \"https://fhir.by/AbstractArea/StructureDefinition/Bundle/MedicationDocument\"\r\n        ]\r\n    },\r\n    \"identifier\": {\r\n        \"system\": \"https://fhir.by/ValueSet/urn:ietf:rfc:3986\",\r\n        \"value\": \"urn:uuid:0c3151bd-1cbf-4d64-b04d-{{$guid}}\"\r\n    },\r\n    \"type\": \"document\",\r\n    \"timestamp\": \"2024-04-07T11:30:00Z\",\r\n    \"entry\": [\r\n        {\r\n            \"fullUrl\": \"Composition/CompositionBundleForTest\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Composition\",\r\n                \"id\": \"{{$guid}}\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/CompDocument\"\r\n                    ]\r\n                },\r\n                \"status\": \"registered\",\r\n                \"type\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/CompositionType\",\r\n                            \"code\": \"general\",\r\n                            \"display\": \"Общая медицинская информация\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"subject\": [\r\n                    {\r\n                        \"reference\": \"Patient/PatientBundleForTest\"\r\n                    }\r\n                ],\r\n                \"date\": \"2024-04-07T11:12:21Z\",\r\n                \"author\": [\r\n                    {\r\n                        \"reference\": \"Practitioner/{{PractitionerMREC}}\"\r\n                    }\r\n                ],\r\n                \"title\": \"CompDocument для наполненного Bundle\",\r\n                \"custodian\": {\r\n                    \"reference\": \"Organization/{{OrganizationMREC}}\"\r\n                }\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Patient/PatientBundleForTest\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Patient\",\r\n                \"id\": \"ExamplePatientWithIdentificationNumber\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/PatientED\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/DocumentKind\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/DigitalDocumentKind\",\r\n                                    \"code\": \"00\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    }\r\n                ],\r\n                \"identifier\": [\r\n                    {\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/PersonalDocumentType\",\r\n                                    \"code\": \"INP\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"value\": \"7551231A009PB1\"\r\n                    }\r\n                ],\r\n                \"active\": true,\r\n                \"name\": [\r\n                    {\r\n                        \"family\": \"Иванов\",\r\n                        \"given\": [\r\n                            \"Петр\",\r\n                            \"Сидорович\"\r\n                        ]\r\n                    }\r\n                ],\r\n                \"birthDate\": \"1990-12-31\",\r\n                \"gender\": \"male\",\r\n                \"telecom\": [\r\n                    {\r\n                        \"system\": \"phone\",\r\n                        \"value\": \"+375291112233\"\r\n                    }\r\n                ],\r\n                \"address\": [\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                            \"version\": \"1.51\",\r\n                                            \"code\": \"BY\",\r\n                                            \"display\": \"Беларусь\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                            \"version\": \"1.3\",\r\n                                            \"code\": \"2938771891184418\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                                \"valueString\": \"кв. 101\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"home\",\r\n                        \"text\": \"Витебская область, г. Витебск, Улица 19-я Городокская, д. 5\"\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                            \"version\": \"1.51\",\r\n                                            \"code\": \"BY\",\r\n                                            \"display\": \"Беларусь\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                            \"version\": \"1.3\",\r\n                                            \"code\": \"12463236041049757\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                                \"valueString\": \"кв. 1201\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"temp\",\r\n                        \"text\": \"Брестская область, г. Пинск, Улица Центральная, д. 9\"\r\n                    }\r\n                ],\r\n                \"link\": [\r\n                    {\r\n                        \"other\": {\r\n                            \"reference\": \"Patient/{{patientId}}\"\r\n                        },\r\n                        \"type\": \"refer\"\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Encounter/EncounterBundleForTest\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Encounter\",\r\n                \"id\": \"ExampleEncounterForMREC\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/EncounterGeneral\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/EncouterMRECConcent\",\r\n                        \"valueBoolean\": false\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/DisabilityFirstTime\",\r\n                        \"valueBoolean\": false\r\n                    }\r\n                ],\r\n                \"identifier\": [\r\n                    {\r\n                        \"value\": \"1245\",\r\n                        \"assigner\": {\r\n                            \"reference\": \"Organization/{{OrganizationMREC}}\",\r\n                            \"display\": \"Учреждение здравоохранения \\\"Витебская областная медико-реабилитационная экспертная комиссия\\\"\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"status\": \"completed\",\r\n                \"class\": [\r\n                    {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/VSTermsOfService\",\r\n                                \"code\": \"1\"\r\n                            }\r\n                        ]\r\n                    }\r\n                ],\r\n                \"priority\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/HealthCareForms\",\r\n                            \"code\": \"planned\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"type\": [\r\n                    {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/TypeOfHealthCare\",\r\n                                \"code\": \"special\"\r\n                            }\r\n                        ]\r\n                    }\r\n                ],\r\n                \"subject\": {\r\n                    \"reference\": \"Patient/{{patientId}}\",\r\n                    \"display\": \"Иванова Лариса Ивановна\"\r\n                },\r\n                \"serviceProvider\": {\r\n                    \"reference\": \"Organization/{{OrganizationMREC}}\"\r\n                },\r\n                \"participant\": [\r\n                    {\r\n                        \"actor\": {\r\n                            \"reference\": \"PractitionerRole/{{PractitionerRoleMREC}}\",\r\n                            \"display\": \"Иванов Владислав Эдуардович\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"actualPeriod\": {\r\n                    \"start\": \"2025-09-01T12:00:00Z\",\r\n                    \"end\": \"2025-09-01T12:15:00Z\"\r\n                },\r\n                \"diagnosis\": [\r\n                    {\r\n                        \"condition\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"Condition/ExampleDiagnosisMREC\"\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"use\": [\r\n                            {\r\n                                \"coding\": [\r\n                                    {\r\n                                        \"system\": \"https://fhir.by/ValueSet/TypeOfDiagnosis\",\r\n                                        \"code\": \"mainDiagnosis\"\r\n                                    }\r\n                                ]\r\n                            }\r\n                        ]\r\n                    }\r\n                ],\r\n                \"location\": [\r\n                    {\r\n                        \"location\": {\r\n                            \"reference\": \"Location/{{LocationMREC}}\"\r\n                        }\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Condition/ExampleDiagnosisMREC\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Condition\",\r\n                \"id\": \"ExampleDiagnosisMREC\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/FinalDiagnosis\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/KindOfDiagnosis\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/KindOfDiagnosisCode\",\r\n                                    \"code\": \"Сlinical-functional\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/AssertedDate\",\r\n                        \"valueDateTime\": \"2025-09-01\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/FirstTimeRevealed\",\r\n                        \"valueBoolean\": true\r\n                    }\r\n                ],\r\n                \"clinicalStatus\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"http://terminology.hl7.org/CodeSystem/condition-clinical\",\r\n                            \"code\": \"active\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"code\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/InternClassificDiseases10\",\r\n                            \"code\": \"M16.6\",\r\n                            \"display\": \"M16.6 - Другие вторичные коксартрозы двусторонние\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"subject\": {\r\n                    \"reference\": \"Patient/{{patientId}}\"\r\n                },\r\n                \"onsetDateTime\": \"2025-09-01\",\r\n                \"recordedDate\": \"2024-09-01\",\r\n                \"participant\": [\r\n                    {\r\n                        \"actor\": {\r\n                            \"reference\": \"PractitionerRole/{{PractitionerRoleMREC}}\",\r\n                            \"display\": \"Иванов Владислав Эдуардович\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"note\": [\r\n                    {\r\n                        \"text\": \"Двусторонний диспластический коксартроз 3 ст., ФК III справа, ФК IV слева\"\r\n                    }\r\n                ]\r\n            }\r\n        }\r\n    ]\r\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Bundle/$import",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Bundle",
                    "$import"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "получение статуса импорта пакета медицинских данных",
              "request": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Bundle/{{bundleId}}/$status",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Bundle",
                    "{{bundleId}}",
                    "$status"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Поиск обращения пациента к врачу",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "var jsonData = pm.response.json();\r",
                      "\r",
                      "// Фильтруем только Encounter ресурсы, исключая OperationOutcome\r",
                      "let encounterEntries = jsonData.entry.filter(entry => \r",
                      "    entry.resource && entry.resource.resourceType === \"Encounter\"\r",
                      ");\r",
                      "\r",
                      "if (encounterEntries.length > 0) {\r",
                      "    // Сортируем по дате lastUpdated (от новых к старым) и берем самый свежий\r",
                      "    encounterEntries.sort((a, b) => \r",
                      "        new Date(b.resource.meta.lastUpdated) - new Date(a.resource.meta.lastUpdated)\r",
                      "    );\r",
                      "    \r",
                      "    let latestEncounter = encounterEntries[0];\r",
                      "    let encounterId = latestEncounter.resource.id;\r",
                      "    pm.collectionVariables.set(\"encounterId\", encounterId);\r",
                      "    console.log(\"Latest encounterId:\", encounterId);\r",
                      "    console.log(\"Last updated:\", latestEncounter.resource.meta.lastUpdated);\r",
                      "} else {\r",
                      "    console.log(\"No Encounter resources found in response\");\r",
                      "}"
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "protocolProfileBehavior": {
                "disableBodyPruning": true
              },
              "request": {
                "method": "GET",
                "header": [],
                "body": {
                  "mode": "raw",
                  "raw": "",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient/{{patientId}}/Encounter?_profile=https://fhir.by/StructureDefinition/EncounterGeneral&patient={{patientId}}&_sort=-_lastUpdated",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient",
                    "{{patientId}}",
                    "Encounter"
                  ],
                  "query": [
                    {
                      "key": "_profile",
                      "value": "https://fhir.by/StructureDefinition/EncounterGeneral"
                    },
                    {
                      "key": "patient",
                      "value": "{{patientId}}"
                    },
                    {
                      "key": "_sort",
                      "value": "-_lastUpdated"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Поиск диагноза пациента к врачу",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "var jsonData = pm.response.json();\r",
                      "let patientId = jsonData.entry.find(obj => obj.resource.resourceType === \"Patient\").resource.id;\r",
                      "\r",
                      "pm.collectionVariables.set(\"patientId\", patientId);\r",
                      "console.log(patientId)\r",
                      ""
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "protocolProfileBehavior": {
                "disableBodyPruning": true
              },
              "request": {
                "method": "GET",
                "header": [],
                "body": {
                  "mode": "raw",
                  "raw": "",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient/{{patientId}}/Condition?_sort=-_lastUpdated&_profile=https://fhir.by/StructureDefinition/FinalDiagnosis",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient",
                    "{{patientId}}",
                    "Condition"
                  ],
                  "query": [
                    {
                      "key": "_sort",
                      "value": "-_lastUpdated"
                    },
                    {
                      "key": "_profile",
                      "value": "https://fhir.by/StructureDefinition/FinalDiagnosis"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Метод импорта пакета медицинской информации (заключение МРЭК)",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Валидный бандл должен отработать со статусом 202\", function () {\r\n    pm.response.to.have.status(202);\r\n});\r\n\r\nvar jsonData = pm.response.json();\r\nlet bundleId = jsonData.parameter.find(obj => obj.name === \"ResourceId\").valueString;\r\nlet statusReference = jsonData.parameter.find(obj => obj.name === \"OperationStatusReference\");\r\n\r\nconsole.log(statusReference.valueReference.reference);\r\n\r\npm.collectionVariables.set(\"bundleId\", bundleId);\r\npm.collectionVariables.set(\"StatusUrl\", statusReference.valueReference.reference);\r\n"
                    ]
                  }
                }
              ],
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Fhir-By-Version",
                    "value": "active"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\r\n    \"resourceType\": \"Bundle\",\r\n    \"id\": \"BundleConclusionMRECDisability190110\",\r\n    \"meta\": {\r\n        \"profile\": [\r\n            \"https://fhir.by/AbstractArea/StructureDefinition/Bundle/BundleMREC\"\r\n        ]\r\n    },\r\n    \"identifier\": {\r\n        \"system\": \"https://minzdrav.gov.by\",\r\n        \"value\": \"{{identifier}}\"\r\n    },\r\n    \"type\": \"document\",\r\n    \"timestamp\": \"2025-09-01T11:12:21Z\",\r\n    \"entry\": [\r\n        {\r\n            \"fullUrl\": \"Composition/ExampleCompositionMRECDisability\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Composition\",\r\n                \"id\": \"ExampleCompositionMRECDisability\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/DocumentMREC\"\r\n                    ]\r\n                },\r\n                \"status\": \"final\",\r\n                \"type\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/CompositionType\",\r\n                            \"code\": \"conclusion-mrec\",\r\n                            \"display\": \"Заключение МРЭК\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"subject\": [\r\n                    {\r\n                        \"reference\": \"Patient/ExamplePatientWithIdentificationNumber\"\r\n                    }\r\n                ],\r\n                \"date\": \"2025-09-01T11:12:21Z\",\r\n                \"author\": [\r\n                    {\r\n                        \"reference\": \"Practitioner/{{PractitionerMREC}}\"\r\n                    }\r\n                ],\r\n                \"title\": \"Уточненный состав необходимых данных о лице, предоставляемых медико-реабилитационными экспертными комиссиями\",\r\n                \"custodian\": {\r\n                    \"reference\": \"Organization/{{OrganizationMREC}}\"\r\n                },\r\n                \"event\": [\r\n                    {\r\n                        \"detail\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"ClinicalImpression/ExampleConclusionMREC\"\r\n                                }\r\n                            }\r\n                        ]\r\n                    },\r\n                    {\r\n                        \"detail\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"CarePlan/ExampleIPR\"\r\n                                }\r\n                            }\r\n                        ]\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Patient/ExamplePatientWithIdentificationNumber\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Patient\",\r\n                \"id\": \"ExamplePatientWithIdentificationNumber\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/PatientED\"\r\n                    ]\r\n                },\r\n                \r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/DocumentKind\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/DigitalDocumentKind\",\r\n                                    \"code\": \"04\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    }\r\n                ],\r\n                \r\n                \"identifier\": [\r\n                   {\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/PersonalDocumentType\",\r\n                                    \"code\": \"INP\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"value\": \"7551231A009PB1\"\r\n                    }\r\n                ],\r\n                \"active\": true,\r\n                \"name\": [\r\n                    {\r\n                        \"family\": \"Иванов\",\r\n                        \"given\": [\r\n                            \"Петр\",\r\n                            \"Сидорович\"\r\n                        ]\r\n                    }\r\n                ],\r\n                \"birthDate\": \"1990-12-31\",\r\n                \"telecom\": [\r\n                    {\r\n                        \r\n                        \"system\": \"phone\",\r\n                        \"value\": \"+375291112233\"\r\n                    }\r\n                    \r\n                ],\r\n                \"address\": [\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                            \"version\": \"1.51\",\r\n                                            \"code\": \"BY\",\r\n                                            \"display\": \"Беларусь\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                            \"version\": \"1.3\",\r\n                                            \"code\": \"2938771891184418\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                                \"valueString\": \"кв. 101\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"home\",\r\n                        \"text\": \"Витебская область, г. Витебск, Улица 19-я Городокская, д. 5\"\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                            \"version\": \"1.51\",\r\n                                            \"code\": \"BY\",\r\n                                            \"display\": \"Беларусь\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                            \"version\": \"1.3\",\r\n                                            \"code\": \"12463236041049757\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                                \"valueString\": \"кв. 1201\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"temp\",\r\n                        \"text\": \"Брестская область, г. Пинск, Улица Центральная, д. 9\"\r\n                    }\r\n                ],\r\n                \"link\": [\r\n                    {\r\n                        \"other\": {\r\n                            \"reference\": \"Patient/{{patientId}}\"\r\n                        },\r\n                        \"type\": \"refer\"\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"ClinicalImpression/ExampleConclusionMREC\",\r\n            \"resource\": {\r\n                \"resourceType\": \"ClinicalImpression\",\r\n                \"id\": \"ExampleConclusionMREC\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/ConclusionMREC\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CodesReasonForMREC\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/ReasonForMREC\",\r\n                                            \"code\": \"end-of-term\",\r\n                                            \"display\": \"переосвидетельствование пациента  по  окончанию  срока  инвалидности\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"url\": \"https://fhir.by/StructureDefinition/ReasonForMREC\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/ExtSurveyTypeMREC\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/SurveyTypeMREC\",\r\n                                    \"code\": \"10\",\r\n                                    \"display\": \"повторное очное\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/LossOfProfessionalAbilityPercentage\",\r\n                                \"valueQuantity\": {\r\n                                    \"value\": 25,\r\n                                    \"unit\": \"%\",\r\n                                    \"system\": \"https://fhir.by/ValueSet/UnitsOfMeasureBy\"\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/LossOfProfessionalAbilityCase\",\r\n                                \"valueString\": \"Страховой случай, его дата, документ, послуживший основанием для установления степени утраты профессиональной трудоспособности\"\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/LossOfProfessionalAbilityTerm\",\r\n                                \"valuePeriod\": {\r\n                                    \"start\": \"2025-09-20\",\r\n                                    \"end\": \"2026-09-20\"\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"url\": \"https://fhir.by/StructureDefinition/LossOfProfessionalAbility\"\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ContraindicatedFactors\",\r\n                                \"valueString\": \"Противопоказанные факторы производственной среды, тяжесть и напряженность трудового процесса, виды работ\"\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/IndicatedFactors\",\r\n                                \"valueString\": \"Показанные условия труда и режим рабочего времени\"\r\n                            }\r\n                        ],\r\n                        \"url\": \"https://fhir.by/StructureDefinition/RequirementsForWorking\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/DisabilityCertificate\",\r\n                        \"valueIdentifier\": {\r\n                            \"value\": \"15№ 0003839\",\r\n                            \"period\": {\r\n                                \"start\": \"2025-09-20\"\r\n                                \r\n                            },\r\n                            \"assigner\": {\r\n                                \"reference\": \"Organization/{{OrganizationMREC}}\"\r\n                            }\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/DisabilityGroup\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/DisabilityGroup\",\r\n                                    \"code\": \"2_group\",\r\n                                    \"display\": \"II группа\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/DisabilityReason\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/DisabilityReason\",\r\n                                    \"code\": \"general\",\r\n                                    \"display\": \"общее заболевание\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/AdditionalTypesOfHelp\",\r\n                        \"valueString\": \"не нуждается в постоянной помощи\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/AdditionalTypesOfCare\",\r\n                        \"valueString\": \"не нуждается в постоянном уходе\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/AdditionalForConclusionMREC\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/AdditionalForConclusionMREC\",\r\n                                    \"code\": \"absens\",\r\n                                    \"display\": \"отсутствует\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/ProgramRehabilitionMREC\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/ProgramRehabilitionMREC\",\r\n                                    \"code\": \"ipra\",\r\n                                    \"display\": \"индивидуальная программа реабилитации, абилитации инвалида\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    }\r\n                   \r\n                ],\r\n                \"encounter\": {\r\n                    \"reference\": \"Encounter/{{encounterId}}\"\r\n                },\r\n                \"identifier\": [\r\n                    {\r\n                        \"value\": \"{{identifier}}\",\r\n                        \"period\": {\r\n                            \"start\": \"2025-09-20\"\r\n                            \r\n                        },\r\n                        \"assigner\": {\r\n                            \"extension\": [\r\n                                {\r\n                                    \"url\": \"https://fhir.by/StructureDefinition/LocationReference\",\r\n                                    \"valueReference\": {\r\n                                        \"reference\": \"Location/{{LocationMREC}}\"\r\n                                    }\r\n                                }\r\n                            ],\r\n                            \"reference\": \"Organization/{{OrganizationMREC}}\",\r\n                            \"display\": \"Учреждение здравоохранения \\\"Витебская областная медико-реабилитационная экспертная комиссия\\\"\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"status\": \"completed\",\r\n                \"description\": \"Заключение МРЭК №{{identifier}}, Иванова Лариса Ивановна, 31.12.1990\",\r\n                \"subject\": {\r\n                    \"reference\": \"Patient/ExamplePatientWithIdentificationNumber\"\r\n                },\r\n                \"effectiveDateTime\": \"2025-09-20\",\r\n                \"date\": \"2025-09-20\",\r\n                \"performer\": {\r\n                    \"reference\": \"PractitionerRole/{{PractitionerRoleMREC}}\"\r\n                },\r\n                \"previous\": {\r\n                    \"extension\": [\r\n                        {\r\n                            \"url\": \"https://fhir.by/StructureDefinition/ConfirmedConclusion\",\r\n                            \"valueCodeableConcept\": {\r\n                                \"coding\": [\r\n                                    {\r\n                                        \"system\": \"https://fhir.by/ValueSet/ConfirmedConclusionMREC\",\r\n                                        \"code\": \"2\",\r\n                                        \"display\": \"отменяется\"\r\n                                    }\r\n                                ]\r\n                            }\r\n                        }\r\n                    ],\r\n                    \"reference\": \"ClinicalImpression/{{clinicalImpressionId}}\",\r\n                    \"display\": \"Заключение МРЭК 04-300189168-2025000000000074 31.12.1990\"\r\n                }\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"CarePlan/ExampleIPR\",\r\n            \"resource\": {\r\n                \"resourceType\": \"CarePlan\",\r\n                \"id\": \"ExampleIPR\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/IPR\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/AdditionalForConclusionMREC\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/AdditionalForConclusionMREC\",\r\n                                    \"code\": \"absens\",\r\n                                    \"display\": \"отсутствует\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ContraindicatedFactors\",\r\n                                \"valueString\": \"Противопоказанные факторы производственной среды, тяжесть и напряженность трудового процесса, виды работ\"\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/IndicatedFactors\",\r\n                                \"valueString\": \"Показанные условия труда и режим рабочего времени\"\r\n                            }\r\n                        ],\r\n                        \"url\": \"https://fhir.by/StructureDefinition/RequirementsForWorking\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/ReferredInitially\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/RehabProgramm\",\r\n                                    \"code\": \"repeat\",\r\n                                    \"display\": \"повторно\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/ReferenceToConclusionMREC\",\r\n                        \"valueReference\": {\r\n                            \"reference\": \"ClinicalImpression/ExampleConclusionMREC\"\r\n                        }\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/DisorderCode\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/DisordersFunctionAndSystem\",\r\n                                            \"code\": \"handdisf\",\r\n                                            \"display\": \"нарушение функции хвата и удержания кисти, манипуляционной функции кисти\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/DisorderGrade\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/DegreesOfManifestationOfDisfunctions\",\r\n                                            \"code\": \"light\",\r\n                                            \"display\": \"легкие\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"url\": \"https://fhir.by/StructureDefinition/ExtDisordersFunctionAndSystem\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/SpecialtyMREC\",\r\n                        \"valueString\": \"маляр-штукатур\"\r\n                    },\r\n                    \r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/PatientStudyKind\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/EducationKind\",\r\n                                            \"code\": \"student\",\r\n                                            \"display\": \"студент дневной формы обучения\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/PatientStudyPlace\",\r\n                                \"valueString\": \"Наименование и адрес учреждения образования или номер и адрес учреждения дошкольного образования\"\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/PatientTermOfStudy\",\r\n                                \"valuePeriod\": {\r\n                                    \"start\": \"2024-01-05\"\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"url\": \"https://fhir.by/StructureDefinition/PatientStudy\"\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/PatientJobProfession\",\r\n                                \"valueString\": \"плиточник\"\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/PatientJobProfessionCode\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/SpecialtyProfPerson\",\r\n                                            \"code\": \"7122-004\",\r\n                                            \"display\": \"Облицовщик-плиточник\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/PatientJobPlace\",\r\n                                \"valueString\": \"ИП\"\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/TermOFWork\",\r\n                                \"valuePeriod\": {\r\n                                    \"start\": \"2024-09-01\"\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/MainJobPlace\",\r\n                                \"valueBoolean\": true\r\n                            }\r\n                        ],\r\n                        \"url\": \"https://fhir.by/StructureDefinition/PatientJob\"\r\n                    }\r\n                ],\r\n                \"identifier\": [\r\n                    {\r\n                        \"value\": \"{{identifier}}\",\r\n                        \"assigner\": {\r\n                            \"extension\": [\r\n                                {\r\n                                    \"url\": \"https://fhir.by/StructureDefinition/LocationReference\",\r\n                                    \"valueReference\": {\r\n                                        \"reference\": \"Location/{{LocationMREC}}\"\r\n                                    }\r\n                                }\r\n                            ],\r\n                            \"reference\": \"Organization/{{OrganizationMREC}}\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"period\": {\r\n                    \"start\": \"2025-09-20\",\r\n                    \"end\": \"2026-09-20\"\r\n                },\r\n                \"basedOn\": [\r\n                    {\r\n                        \"identifier\": {\r\n                            \"value\": \"{{identifier}}\",\r\n                            \"period\": {\r\n                                \"start\": \"2025-09-20\"\r\n                            }\r\n                        }\r\n                    }\r\n                ],\r\n                \"status\": \"active\",\r\n                \"intent\": \"plan\",\r\n                \"title\": \"Программа реабилитации инвалида\",\r\n                \"subject\": {\r\n                    \"reference\": \"Patient/ExamplePatientWithIdentificationNumber\"\r\n                },\r\n                \"created\": \"2025-09-20\",\r\n                \"custodian\": {\r\n                    \"reference\": \"Organization/{{OrganizationMREC}}\"\r\n                },\r\n                \"contributor\": [\r\n                    {\r\n                        \"reference\": \"PractitionerRole/{{PractitionerRoleMREC}}\",\r\n                        \"display\": \"Председатель МРЭК\"\r\n                    }\r\n                ],\r\n                \"addresses\": [\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ActivitiesLoss\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/FunctionalClass\",\r\n                                            \"code\": \"2\",\r\n                                            \"display\": \"Функциональный класс II\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"concept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/RestrictCategoriesActivity\",\r\n                                    \"code\": \"abletoselfcare\",\r\n                                    \"display\": \"Способность к самообслуживанию.\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ActivitiesLoss\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/FunctionalClass\",\r\n                                            \"code\": \"3\",\r\n                                            \"display\": \"Функциональный класс III.\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"concept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/RestrictCategoriesActivity\",\r\n                                    \"code\": \"abletoorientate\",\r\n                                    \"display\": \"Способность к ориентации.\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    }\r\n                ],\r\n                \"activity\": [\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"extension\": [\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/MedicalRehabilitationEventCode\",\r\n                                        \"valueCodeableConcept\": {\r\n                                            \"coding\": [\r\n                                                {\r\n                                                    \"system\": \"https://fhir.by/ValueSet/RehubActivities\",\r\n                                                    \"code\": \"complex\",\r\n                                                    \"display\": \"Физиотерапия\"\r\n                                                }\r\n                                            ]\r\n                                        }\r\n                                    },\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/RehabilitationEventNeediness\",\r\n                                        \"valueCodeableConcept\": {\r\n                                            \"coding\": [\r\n                                                {\r\n                                                    \"system\": \"https://fhir.by/ValueSet/Neediness\",\r\n                                                    \"code\": \"need\",\r\n                                                    \"display\": \"нуждается\"\r\n                                                }\r\n                                            ]\r\n                                        }\r\n                                    },\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/RehabilitationEventString\",\r\n                                        \"valueString\": \"Магнитотерапия на всё\"\r\n                                    },\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/RehabilitationEventPeriod\",\r\n                                        \"valuePeriod\": {\r\n                                            \"start\": \"2024-01-05\"\r\n                                        }\r\n                                    }\r\n                                ],\r\n                                \"url\": \"https://fhir.by/StructureDefinition/MedicalRehabilitationEvent\"\r\n                            }\r\n                        ],\r\n                        \"progress\": [\r\n                            {\r\n                                \"text\": \"Поликлиника №15 в течение месяца \"\r\n                            }\r\n                        ]\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            \r\n                            {\r\n                                \"extension\": [\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/SocialRehabilitationEventCode\",\r\n                                        \"valueCodeableConcept\": {\r\n                                            \"coding\": [\r\n                                                {\r\n                                                    \"system\": \"https://fhir.by/ValueSet/SocRehab\",\r\n                                                    \"code\": \"psychohelp\",\r\n                                                    \"display\": \"Психологическая помощь\"\r\n                                                }\r\n                                            ]\r\n                                        }\r\n                                    },\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/RehabilitationEventNeediness\",\r\n                                        \"valueCodeableConcept\": {\r\n                                            \"coding\": [\r\n                                                {\r\n                                                    \"system\": \"https://fhir.by/ValueSet/Neediness\",\r\n                                                    \"code\": \"need\",\r\n                                                    \"display\": \"нуждается\"\r\n                                                }\r\n                                            ]\r\n                                        }\r\n                                    },\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/RehabilitationEventString\",\r\n                                        \"valueString\": \"Другие методы реабилитации или ТССР\"\r\n                                    },\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/RehabilitationEventPeriod\",\r\n                                        \"valuePeriod\": {\r\n                                            \"start\": \"2025-09-20\"\r\n                                        }\r\n                                    }\r\n                                ],\r\n                                \"url\": \"https://fhir.by/StructureDefinition/SocialRehabilitationEvent\"\r\n                            }\r\n                        ],\r\n                        \"progress\": [\r\n                            {\r\n                                \"text\": \"ВОП Иванов ИИ - молодец\"\r\n                            }\r\n                        ]\r\n                    }\r\n                ],\r\n                \"note\": [\r\n                    {\r\n                        \"text\": \"Текстовое содержимое аннотации\"\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Provenance/ExampleProvenanceDocumentInfoMRECDisability\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Provenance\",\r\n                \"id\": \"ExampleProvenanceDocumentInfoMRECDisability\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/ProvenanceDocumentInfoMREC\"\r\n                    ]\r\n                },\r\n                \"target\": [\r\n                    {\r\n                        \"reference\": \"Patient/ExamplePatientWithIdentificationNumber\"\r\n                    }\r\n                ],\r\n                \"recorded\": \"2024-09-20T11:12:21Z\",\r\n                \"location\": {\r\n                    \"extension\": [\r\n                        {\r\n                            \"url\": \"https://fhir.by/StructureDefinition/ExtStringValue\",\r\n                            \"valueString\": \"{{codeMrecLocation}}\"\r\n                        }\r\n                    ],\r\n                    \"reference\": \"Location/{{LocationMREC}}\",\r\n                    \"display\": \"{{LocationName}}\"\r\n                },\r\n                \"authorization\": [\r\n                    {\r\n                        \"reference\": {\r\n                            \"reference\": \"ClinicalImpression/ExampleConclusionMREC\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"patient\": {\r\n                    \"reference\": \"Patient/ExamplePatientWithIdentificationNumber\"\r\n                },\r\n                \"agent\": [\r\n                    {\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/AgentTypeProvenance\",\r\n                                    \"code\": \"organization\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"who\": {\r\n                            \"extension\": [\r\n                                {\r\n                                    \"url\": \"https://fhir.by/StructureDefinition/ExtStringValue\",\r\n                                    \"valueString\": \"{{codeMREC}}\"\r\n                                }\r\n                            ],\r\n                            \"reference\": \"Organization/{{OrganizationMREC}}\",\r\n                            \"display\": \"{{OrganizationName}}\"\r\n                        }\r\n                    },\r\n                    {\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/AgentTypeProvenance\",\r\n                                    \"code\": \"practitioner\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"who\": {\r\n                            \"reference\": \"Practitioner/{{PractitionerMREC}}\",\r\n                            \"display\": \"{{PractitionerName}}\"\r\n                        }\r\n                    },\r\n                    {\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/AgentTypeProvenance\",\r\n                                    \"code\": \"practitionerRole\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"who\": {\r\n                            \"reference\": \"PractitionerRole/{{PractitionerRoleMREC}}\",\r\n                            \"display\": \"{{PractitionerRoleName}}\"\r\n                        }\r\n                    }\r\n                ]\r\n            }\r\n        }\r\n    ]\r\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Bundle/$import",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Bundle",
                    "$import"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Метод получения статуса операции импорта пакета медицинской информации",
              "request": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Bundle/{{bundleId}}/$status",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Bundle",
                    "{{bundleId}}",
                    "$status"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Метод проверки наличия у пациента актуальных заключений МРЭК",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      ""
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "request": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient/{{patientId}}/ClinicalImpression?_profile=https://fhir.by/StructureDefinition/ConclusionMREC&status=completed,stopped&_sort=-_lastUpdated",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient",
                    "{{patientId}}",
                    "ClinicalImpression"
                  ],
                  "query": [
                    {
                      "key": "_profile",
                      "value": "https://fhir.by/StructureDefinition/ConclusionMREC"
                    },
                    {
                      "key": "status",
                      "value": "completed,stopped"
                    },
                    {
                      "key": "_sort",
                      "value": "-_lastUpdated",
                      "type": "text"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Метод проверка наличия у пациента актуальных индивидуальных программ реабилитации",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      ""
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "protocolProfileBehavior": {
                "disableBodyPruning": true
              },
              "request": {
                "method": "GET",
                "header": [],
                "body": {
                  "mode": "raw",
                  "raw": "",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient/{{patientId}}/CarePlan?_profile=https://fhir.by/StructureDefinition/IPR&status=active,revoked&_sort=-_lastUpdated",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient",
                    "{{patientId}}",
                    "CarePlan"
                  ],
                  "query": [
                    {
                      "key": "_profile",
                      "value": "https://fhir.by/StructureDefinition/IPR"
                    },
                    {
                      "key": "status",
                      "value": "active,revoked"
                    },
                    {
                      "key": "_sort",
                      "value": "-_lastUpdated",
                      "type": "text"
                    }
                  ]
                }
              },
              "response": []
            }
          ],
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "packages": {},
                "requests": {},
                "exec": [
                  ""
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "packages": {},
                "requests": {},
                "exec": [
                  ""
                ]
              }
            }
          ]
        },
        {
          "name": "Кейс 3. Пациент без инвалидности направлен на медико-социальную экспертизу для освидетельствования.(иностранец)",
          "item": [
            {
              "name": "Создание пациента",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Валидный бандл должен отработать со статусом 202\", function () {\r\n    pm.response.to.have.status(202);\r\n});\r\n\r\nvar jsonData = pm.response.json();\r\nlet bundleId = jsonData.parameter.find(obj => obj.name === \"ResourceId\").valueString;\r\nlet statusReference = jsonData.parameter.find(obj => obj.name === \"OperationStatusReference\");\r\n\r\nconsole.log(statusReference.valueReference.reference);\r\n\r\npm.collectionVariables.set(\"bundleId\", bundleId);\r\npm.collectionVariables.set(\"StatusUrl\", statusReference.valueReference.reference);\r\n"
                    ]
                  }
                }
              ],
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Fhir-By-Version",
                    "value": "active"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\r\n                \"resourceType\": \"Patient\",\r\n                \"id\": \"ExampleForTestPatientWithoutId\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/PatientWithoutIdentificationNumber\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/PatientJobProfession\",\r\n                                \"valueString\": \"Ветеринарный врач\"\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/PatientJobProfessionCode\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/SpecialtyProfPerson\",\r\n                                            \"code\": \"2250-002\",\r\n                                            \"display\": \"Ветеринарный врач\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/PatientJobPlace\",\r\n                                \"valueString\": \"ОАО Ветеринарная клиника «Друг»\"\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/TermOFWork\",\r\n                                \"valuePeriod\": {\r\n                                    \"start\": \"2023-01-01\"\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/MainJobPlace\",\r\n                                \"valueBoolean\": true\r\n                            }\r\n                        ],\r\n                        \"url\": \"https://fhir.by/StructureDefinition/PatientJob\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/DisabilityGroup\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/DisabilityGroup\",\r\n                                    \"code\": \"2_group\",\r\n                                    \"display\": \"II группа\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/DisabilityReason\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/DisabilityReason\",\r\n                                    \"code\": \"general\",\r\n                                    \"display\": \"общее заболевание\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    }\r\n                ],\r\n                \"identifier\": [\r\n                   {\r\n                        \"use\": \"usual\",\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/PersonalDocumentType\",\r\n                                    \"code\": \"RCN\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"value\": \"A00001\"\r\n                    },\r\n                    {\r\n                        \"use\": \"usual\",\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/PersonalDocumentType\",\r\n                                    \"code\": \"FDN\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"value\": \"BM00022\"\r\n                    }\r\n                    \r\n                ],\r\n                \"active\": true,\r\n                \"name\": [\r\n                    {\r\n                        \"family\": \"Ковальски\",\r\n                        \"given\": [\r\n                            \"Гражина\"\r\n                            \r\n                        ]\r\n                    }\r\n                ],\r\n                \"telecom\": [\r\n                    {\r\n                        \"system\": \"phone\",\r\n                        \"value\": \"+375291112244\"\r\n                    }\r\n                ],\r\n                \"gender\": \"female\",\r\n                \"birthDate\": \"1987-05-15\",\r\n                \"deceasedBoolean\": false,\r\n                \"address\": [\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                            \"code\": \"BY\",\r\n                                            \"display\": \"Беларусь\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                            \"code\": \"72609920778\",\r\n                                            \"display\": \"Переулок Снежный\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                                \"valueString\": \"кв. 11\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"home\",\r\n                        \"text\": \"Могилевская область, г.Могилев, Переулок Гоголя, д.19\",\r\n                        \"postalCode\": \"212011\"\r\n                    }\r\n                ],\r\n                \"contact\": [\r\n                    {\r\n                        \"name\": {\r\n                            \"family\": \"Михайлова\",\r\n                            \"given\": [\r\n                                \"Лариса\"\r\n                            ]\r\n                        },\r\n                        \"telecom\": [\r\n                            {\r\n                                \"system\": \"phone\",\r\n                                \"value\": \"80299099090\"\r\n                            }\r\n                        ]\r\n                    }\r\n                ]\r\n            }",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "поиск пациента по идентификационному номеру",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "var jsonData = pm.response.json();\r",
                      "let patientId = jsonData.entry.find(obj => obj.resource.resourceType === \"Patient\").resource.id;\r",
                      "\r",
                      "pm.collectionVariables.set(\"patientId\", patientId);\r",
                      "console.log(patientId)\r",
                      ""
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "protocolProfileBehavior": {
                "disableBodyPruning": true
              },
              "request": {
                "method": "GET",
                "header": [],
                "body": {
                  "mode": "raw",
                  "raw": "",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient?identifier=BM00022",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient"
                  ],
                  "query": [
                    {
                      "key": "identifier",
                      "value": "BM00022"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Метод получения идентификатора электронного документа",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "var jsonData = pm.response.json();\r",
                      "let identifier = jsonData.parameter.find(obj => obj.name === \"identifier\").valueString;\r",
                      "pm.collectionVariables.set(\"identifier\", identifier);\r",
                      "console.log(identifier)"
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "request": {
                "method": "POST",
                "header": [],
                "body": {
                  "mode": "raw",
                  "raw": "{\r\n\"resourceType\" : \"Parameters\",\r\n\"parameter\" : [{\r\n    \"name\" : \"document-code\",\r\n    \"valueCoding\" : {\r\n        \"system\": \"https://fhir.by/ValueSet/DigitalDocumentKind\",\r\n        \"code\": \"04\"\r\n    }\r\n}]\r\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/$get-document-id",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "$get-document-id"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "импорт пакета медицинских данных",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Валидный бандл должен отработать со статусом 202\", function () {\r\n    pm.response.to.have.status(202);\r\n});\r\n\r\nvar jsonData = pm.response.json();\r\nlet bundleId = jsonData.parameter.find(obj => obj.name === \"ResourceId\").valueString;\r\nlet statusReference = jsonData.parameter.find(obj => obj.name === \"OperationStatusReference\");\r\n\r\nconsole.log(statusReference.valueReference.reference);\r\n\r\npm.collectionVariables.set(\"bundleId\", bundleId);\r\npm.collectionVariables.set(\"StatusUrl\", statusReference.valueReference.reference);\r\n"
                    ]
                  }
                }
              ],
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Fhir-By-Version",
                    "value": "active"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\r\n    \"resourceType\": \"Bundle\",\r\n    \"id\": \"BundleForTest\",\r\n    \"meta\": {\r\n        \"profile\": [\r\n            \"https://fhir.by/AbstractArea/StructureDefinition/Bundle/MedicationDocument\"\r\n        ]\r\n    },\r\n    \"identifier\": {\r\n        \"system\": \"https://fhir.by/ValueSet/urn:ietf:rfc:3986\",\r\n        \"value\": \"urn:uuid:0c3151bd-1cbf-4d64-b04d-{{$guid}}\"\r\n    },\r\n    \"type\": \"document\",\r\n    \"timestamp\": \"2024-04-07T11:30:00Z\",\r\n    \"entry\": [\r\n        {\r\n            \"fullUrl\": \"Composition/CompositionBundleForTest\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Composition\",\r\n                \"id\": \"{{$guid}}\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/CompDocument\"\r\n                    ]\r\n                },\r\n                \"status\": \"registered\",\r\n                \"type\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/CompositionType\",\r\n                            \"code\": \"general\",\r\n                            \"display\": \"Общая медицинская информация\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"subject\": [\r\n                    {\r\n                        \"reference\": \"Patient/PatientBundleForTest\"\r\n                    }\r\n                ],\r\n                \"date\": \"2024-04-07T11:12:21Z\",\r\n                \"author\": [\r\n                    {\r\n                        \"reference\": \"Practitioner/{{PractitionerMREC}}\"\r\n                    }\r\n                ],\r\n                \"title\": \"CompDocument для наполненного Bundle\",\r\n                \"custodian\": {\r\n                    \"reference\": \"Organization/{{OrganizationMREC}}\"\r\n                }\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Patient/PatientBundleForTest\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Patient\",\r\n                \"id\": \"ExamplePatientWithIdentificationNumber\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/PatientED\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/DocumentKind\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/DigitalDocumentKind\",\r\n                                    \"code\": \"00\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    }\r\n                ],\r\n                \"identifier\": [\r\n                    {\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/PersonalDocumentType\",\r\n                                    \"code\": \"FDN\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"value\": \"BM00022\"\r\n                    }\r\n                ],\r\n                \"active\": true,\r\n                \"name\": [\r\n                    {\r\n                        \"family\": \"Ковальски\",\r\n                        \"given\": [\r\n                            \"Гражина\"\r\n                        ]\r\n                    }\r\n                ],\r\n               \"birthDate\": \"1987-05-15\",\r\n                \"gender\": \"female\",\r\n                \"telecom\": [\r\n                    {\r\n                        \"system\": \"phone\",\r\n                        \"value\": \"+375291112233\"\r\n                    }\r\n                ],\r\n                \"address\": [\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                            \"version\": \"1.51\",\r\n                                            \"code\": \"BY\",\r\n                                            \"display\": \"Беларусь\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                            \"version\": \"1.3\",\r\n                                            \"code\": \"2938771891184418\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                                \"valueString\": \"кв. 101\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"home\",\r\n                        \"text\": \"Витебская область, г. Витебск, Улица 19-я Городокская, д. 5\"\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                            \"version\": \"1.51\",\r\n                                            \"code\": \"BY\",\r\n                                            \"display\": \"Беларусь\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                            \"version\": \"1.3\",\r\n                                            \"code\": \"12463236041049757\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                                \"valueString\": \"кв. 1201\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"temp\",\r\n                        \"text\": \"Брестская область, г. Пинск, Улица Центральная, д. 9\"\r\n                    }\r\n                ],\r\n                \"link\": [\r\n                    {\r\n                        \"other\": {\r\n                            \"reference\": \"Patient/{{patientId}}\"\r\n                        },\r\n                        \"type\": \"refer\"\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Encounter/EncounterBundleForTest\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Encounter\",\r\n                \"id\": \"ExampleEncounterForMREC\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/EncounterGeneral\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/EncouterMRECConcent\",\r\n                        \"valueBoolean\": false\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/DisabilityFirstTime\",\r\n                        \"valueBoolean\": false\r\n                    }\r\n                ],\r\n                \"identifier\": [\r\n                    {\r\n                        \"value\": \"556\",\r\n                        \"assigner\": {\r\n                            \"reference\": \"Organization/{{OrganizationMREC}}\",\r\n                            \"display\": \"Учреждение здравоохранения \\\"Витебская областная медико-реабилитационная экспертная комиссия\\\"\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"status\": \"completed\",\r\n                \"class\": [\r\n                    {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/VSTermsOfService\",\r\n                                \"code\": \"1\"\r\n                            }\r\n                        ]\r\n                    }\r\n                ],\r\n                \"priority\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/HealthCareForms\",\r\n                            \"code\": \"planned\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"type\": [\r\n                    {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/TypeOfHealthCare\",\r\n                                \"code\": \"special\"\r\n                            }\r\n                        ]\r\n                    }\r\n                ],\r\n                \"subject\": {\r\n                    \"reference\": \"Patient/{{patientId}}\",\r\n                    \"display\": \"Ковальски Гражина\"\r\n                },\r\n                \"serviceProvider\": {\r\n                    \"reference\": \"Organization/{{OrganizationMREC}}\"\r\n                },\r\n                \"participant\": [\r\n                    {\r\n                        \"actor\": {\r\n                            \"reference\": \"PractitionerRole/{{PractitionerRoleMREC}}\",\r\n                            \"display\": \"Иванов Владислав Эдуардович\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"actualPeriod\": {\r\n                    \"start\": \"2025-09-01T12:00:00Z\",\r\n                    \"end\": \"2025-09-01T12:15:00Z\"\r\n                },\r\n                \"diagnosis\": [\r\n                    {\r\n                        \"condition\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"Condition/ExampleDiagnosisMREC\"\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"use\": [\r\n                            {\r\n                                \"coding\": [\r\n                                    {\r\n                                        \"system\": \"https://fhir.by/ValueSet/TypeOfDiagnosis\",\r\n                                        \"code\": \"mainDiagnosis\"\r\n                                    }\r\n                                ]\r\n                            }\r\n                        ]\r\n                    }\r\n                ],\r\n                \"location\": [\r\n                    {\r\n                        \"location\": {\r\n                            \"reference\": \"Location/{{LocationMREC}}\"\r\n                        }\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Condition/ExampleDiagnosisMREC\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Condition\",\r\n                \"id\": \"ExampleDiagnosisMREC\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/FinalDiagnosis\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/KindOfDiagnosis\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/KindOfDiagnosisCode\",\r\n                                    \"code\": \"Сlinical-functional\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/AssertedDate\",\r\n                        \"valueDateTime\": \"2025-09-01\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/FirstTimeRevealed\",\r\n                        \"valueBoolean\": true\r\n                    }\r\n                ],\r\n                \"clinicalStatus\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"http://terminology.hl7.org/CodeSystem/condition-clinical\",\r\n                            \"code\": \"active\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"code\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/InternClassificDiseases10\",\r\n                            \"code\": \"J45.1\",\r\n                            \"display\": \"Неаллергическая астма\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"subject\": {\r\n                    \"reference\": \"Patient/{{patientId}}\"\r\n                },\r\n                \"onsetDateTime\": \"2025-09-01\",\r\n                \"recordedDate\": \"2025-09-01\",\r\n                \"participant\": [\r\n                    {\r\n                        \"actor\": {\r\n                            \"reference\": \"PractitionerRole/{{PractitionerRoleMREC}}\",\r\n                            \"display\": \"Иванов Владислав Эдуардович\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"note\": [\r\n                    {\r\n                        \"text\": \"Неаллергическая астма. Тяжелое течение\"\r\n                    }\r\n                ]\r\n            }\r\n        }\r\n    ]\r\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Bundle/$import",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Bundle",
                    "$import"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "получение статуса импорта пакета медицинских данных",
              "request": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Bundle/{{bundleId}}/$status",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Bundle",
                    "{{bundleId}}",
                    "$status"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "поиск пациента по идентификационному номеру",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "var jsonData = pm.response.json();\r",
                      "let patientId = jsonData.entry.find(obj => obj.resource.resourceType === \"Patient\").resource.id;\r",
                      "\r",
                      "pm.collectionVariables.set(\"patientId\", patientId);\r",
                      "console.log(patientId)\r",
                      ""
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "protocolProfileBehavior": {
                "disableBodyPruning": true
              },
              "request": {
                "method": "GET",
                "header": [],
                "body": {
                  "mode": "raw",
                  "raw": "",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient?identifier=BM00022",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient"
                  ],
                  "query": [
                    {
                      "key": "identifier",
                      "value": "BM00022"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Поиск обращения пациента к врачу",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "var jsonData = pm.response.json();\r",
                      "\r",
                      "// Фильтруем только Encounter ресурсы, исключая OperationOutcome\r",
                      "let encounterEntries = jsonData.entry.filter(entry => \r",
                      "    entry.resource && entry.resource.resourceType === \"Encounter\"\r",
                      ");\r",
                      "\r",
                      "if (encounterEntries.length > 0) {\r",
                      "    // Сортируем по дате lastUpdated (от новых к старым) и берем самый свежий\r",
                      "    encounterEntries.sort((a, b) => \r",
                      "        new Date(b.resource.meta.lastUpdated) - new Date(a.resource.meta.lastUpdated)\r",
                      "    );\r",
                      "    \r",
                      "    let latestEncounter = encounterEntries[0];\r",
                      "    let encounterId = latestEncounter.resource.id;\r",
                      "    pm.collectionVariables.set(\"encounterId\", encounterId);\r",
                      "    console.log(\"Latest encounterId:\", encounterId);\r",
                      "    console.log(\"Last updated:\", latestEncounter.resource.meta.lastUpdated);\r",
                      "} else {\r",
                      "    console.log(\"No Encounter resources found in response\");\r",
                      "}"
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "protocolProfileBehavior": {
                "disableBodyPruning": true
              },
              "request": {
                "method": "GET",
                "header": [],
                "body": {
                  "mode": "raw",
                  "raw": "",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient/{{patientId}}/Encounter?_profile=https://fhir.by/StructureDefinition/EncounterGeneral&patient={{patientId}}&_sort=-_lastUpdated",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient",
                    "{{patientId}}",
                    "Encounter"
                  ],
                  "query": [
                    {
                      "key": "_profile",
                      "value": "https://fhir.by/StructureDefinition/EncounterGeneral"
                    },
                    {
                      "key": "patient",
                      "value": "{{patientId}}"
                    },
                    {
                      "key": "_sort",
                      "value": "-_lastUpdated"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Поиск диагноза пациента к врачу",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "var jsonData = pm.response.json();\r",
                      "let patientId = jsonData.entry.find(obj => obj.resource.resourceType === \"Patient\").resource.id;\r",
                      "\r",
                      "pm.collectionVariables.set(\"patientId\", patientId);\r",
                      "console.log(patientId)\r",
                      ""
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "protocolProfileBehavior": {
                "disableBodyPruning": true
              },
              "request": {
                "method": "GET",
                "header": [],
                "body": {
                  "mode": "raw",
                  "raw": "",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient/{{patientId}}/Condition?_sort=-_lastUpdated&_profile=https://fhir.by/StructureDefinition/FinalDiagnosis",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient",
                    "{{patientId}}",
                    "Condition"
                  ],
                  "query": [
                    {
                      "key": "_sort",
                      "value": "-_lastUpdated"
                    },
                    {
                      "key": "_profile",
                      "value": "https://fhir.by/StructureDefinition/FinalDiagnosis"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Метод проверки отсутствия у пациента актуальных заключений МРЭК",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      ""
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "request": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient/{{patientId}}/ClinicalImpression?_profile=https://fhir.by/StructureDefinition/ConclusionMREC&status=completed",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient",
                    "{{patientId}}",
                    "ClinicalImpression"
                  ],
                  "query": [
                    {
                      "key": "_profile",
                      "value": "https://fhir.by/StructureDefinition/ConclusionMREC"
                    },
                    {
                      "key": "status",
                      "value": "completed"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Метод импорта пакета медицинской информации (заключение МРЭК)",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "pm.test(\"Валидный бандл должен отработать со статусом 202\", function () {\r",
                      "    pm.response.to.have.status(202);\r",
                      "});\r",
                      "\r",
                      "var jsonData = pm.response.json();\r",
                      "let bundleId = jsonData.parameter.find(obj => obj.name === \"ResourceId\").valueString;\r",
                      "let statusReference = jsonData.parameter.find(obj => obj.name === \"OperationStatusReference\");\r",
                      "\r",
                      "console.log(statusReference.valueReference.reference);\r",
                      "\r",
                      "pm.collectionVariables.set(\"bundleId\", bundleId);\r",
                      "pm.collectionVariables.set(\"StatusUrl\", statusReference.valueReference.reference);\r",
                      ""
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Fhir-By-Version",
                    "value": "active",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\r\n    \"resourceType\": \"Bundle\",\r\n    \"id\": \"BundleConclusionMRECDisability190110\",\r\n    \"meta\": {\r\n        \"profile\": [\r\n            \"https://fhir.by/AbstractArea/StructureDefinition/Bundle/BundleMREC\"\r\n        ]\r\n    },\r\n    \"identifier\": {\r\n        \"system\": \"https://minzdrav.gov.by\",\r\n        \"value\": \"{{identifier}}\"\r\n    },\r\n    \"type\": \"document\",\r\n    \"timestamp\": \"2025-09-01T11:12:21Z\",\r\n    \"entry\": [\r\n        {\r\n            \"fullUrl\": \"Composition/ExampleCompositionMRECDisability\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Composition\",\r\n                \"id\": \"ExampleCompositionMRECDisability\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/DocumentMREC\"\r\n                    ]\r\n                },\r\n                \"status\": \"final\",\r\n                \"type\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/CompositionType\",\r\n                            \"code\": \"conclusion-mrec\",\r\n                            \"display\": \"Заключение МРЭК\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"subject\": [\r\n                    {\r\n                        \"reference\": \"Patient/ExamplePatientWithIdentificationNumber\"\r\n                    }\r\n                ],\r\n                \"date\": \"2025-09-01T11:12:21Z\",\r\n                \"author\": [\r\n                    {\r\n                        \"reference\": \"Practitioner/{{PractitionerMREC}}\"\r\n                    }\r\n                ],\r\n                \"title\": \"Уточненный состав необходимых данных о лице, предоставляемых медико-реабилитационными экспертными комиссиями\",\r\n                \"custodian\": {\r\n                    \"reference\": \"Organization/{{OrganizationMREC}}\"\r\n                },\r\n                \"event\": [\r\n                    {\r\n                        \"detail\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"ClinicalImpression/ExampleConclusionMREC\"\r\n                                }\r\n                            }\r\n                        ]\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Patient/ExamplePatientWithIdentificationNumber\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Patient\",\r\n                \"id\": \"ExamplePatientWithIdentificationNumber\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/PatientED\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/DocumentKind\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/DigitalDocumentKind\",\r\n                                    \"code\": \"04\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    }\r\n                ],\r\n                \"identifier\": [\r\n                    {\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/PersonalDocumentType\",\r\n                                    \"code\": \"FDN\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"value\": \"BM00022\"\r\n                    }\r\n                ],\r\n                \"active\": true,\r\n                \"name\": [\r\n                    {\r\n                        \"family\": \"Ковальски\",\r\n                        \"given\": [\r\n                            \"Гражина\"\r\n                        ]\r\n                    }\r\n                ],\r\n                \"birthDate\": \"1987-05-15\",\r\n                \"telecom\": [\r\n                    {\r\n                        \"system\": \"phone\",\r\n                        \"value\": \"+375291112233\"\r\n                    }\r\n                ],\r\n                \"address\": [\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                            \"version\": \"1.51\",\r\n                                            \"code\": \"BY\",\r\n                                            \"display\": \"Беларусь\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                            \"version\": \"1.3\",\r\n                                            \"code\": \"2938771891184418\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                                \"valueString\": \"кв. 101\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"home\",\r\n                        \"text\": \"Витебская область, г. Витебск, Улица 19-я Городокская, д. 5\"\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                            \"version\": \"1.51\",\r\n                                            \"code\": \"BY\",\r\n                                            \"display\": \"Беларусь\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                            \"version\": \"1.3\",\r\n                                            \"code\": \"12463236041049757\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                                \"valueString\": \"кв. 1201\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"temp\",\r\n                        \"text\": \"Брестская область, г. Пинск, Улица Центральная, д. 9\"\r\n                    }\r\n                ],\r\n                \"link\": [\r\n                    {\r\n                        \"other\": {\r\n                            \"reference\": \"Patient/{{patientId}}\"\r\n                        },\r\n                        \"type\": \"refer\"\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"ClinicalImpression/ExampleConclusionMREC\",\r\n            \"resource\": {\r\n                \"resourceType\": \"ClinicalImpression\",\r\n                \"id\": \"ExampleConclusionMREC\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/ConclusionMREC\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CodesReasonForMREC\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/ReasonForMREC\",\r\n                                            \"code\": \"definition-disability\",\r\n                                            \"display\": \"освидетельствование  пациента\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"url\": \"https://fhir.by/StructureDefinition/ReasonForMREC\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/ExtSurveyTypeMREC\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/SurveyTypeMREC\",\r\n                                    \"code\": \"1\",\r\n                                    \"display\": \"первичное очное\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ContraindicatedFactors\",\r\n                                \"valueString\": \"Противопоказанные факторы производственной среды, тяжесть и напряженность трудового процесса, виды работ\"\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/IndicatedFactors\",\r\n                                \"valueString\": \"Показанные условия труда и режим рабочего времени\"\r\n                            }\r\n                        ],\r\n                        \"url\": \"https://fhir.by/StructureDefinition/RequirementsForWorking\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/DisabilityGroup\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/DisabilityGroup\",\r\n                                    \"code\": \"2_group\",\r\n                                    \"display\": \"II группа\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/DisabilityReason\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/DisabilityReason\",\r\n                                    \"code\": \"general\",\r\n                                    \"display\": \"общее заболевание\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/AdditionalTypesOfHelp\",\r\n                        \"valueString\": \"не нуждается в постоянной помощи\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/AdditionalTypesOfCare\",\r\n                        \"valueString\": \"не нуждается в постоянном уходе\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/AdditionalForConclusionMREC\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/AdditionalForConclusionMREC\",\r\n                                    \"code\": \"absens\",\r\n                                    \"display\": \"отсутствует\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/ProgramRehabilitionMREC\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/ProgramRehabilitionMREC\",\r\n                                    \"code\": \"noipra\",\r\n                                    \"display\": \"индивидуальная программа реабилитации, абилитации инвалида не формировалась\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    }\r\n                ],\r\n                \"encounter\": {\r\n                    \"reference\": \"Encounter/{{encounterId}}\"\r\n                },\r\n                \"identifier\": [\r\n                    {\r\n                        \"value\": \"{{identifier}}\",\r\n                        \"period\": {\r\n                            \"start\": \"2024-09-20\",\r\n                            \"end\": \"2025-09-20\"\r\n                        },\r\n                        \"assigner\": {\r\n                            \"extension\": [\r\n                                {\r\n                                    \"url\": \"https://fhir.by/StructureDefinition/LocationReference\",\r\n                                    \"valueReference\": {\r\n                                        \"reference\": \"Location/{{LocationMREC}}\"\r\n                                    }\r\n                                }\r\n                            ],\r\n                            \"reference\": \"Organization/{{OrganizationMREC}}\",\r\n                            \"display\": \"{{OrganizationName}}\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"status\": \"completed\",\r\n                \"description\": \"Заключение МРЭК №{{identifier}}, Ковальски Гражина, 15.05.1987\",\r\n                \"subject\": {\r\n                    \"reference\": \"Patient/ExamplePatientWithIdentificationNumber\"\r\n                },\r\n                \"effectiveDateTime\": \"2024-09-20\",\r\n                \"date\": \"2024-09-20\",\r\n                \"performer\": {\r\n                    \"reference\": \"PractitionerRole/{{PractitionerRoleMREC}}\"\r\n                }\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Provenance/ExampleProvenanceDocumentInfoMRECDisability\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Provenance\",\r\n                \"id\": \"ExampleProvenanceDocumentInfoMRECDisability\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/ProvenanceDocumentInfoMREC\"\r\n                    ]\r\n                },\r\n                \"target\": [\r\n                    {\r\n                        \"reference\": \"Patient/ExamplePatientWithIdentificationNumber\"\r\n                    }\r\n                ],\r\n                \"recorded\": \"2024-09-20T11:12:21Z\",\r\n                \"location\": {\r\n                    \"extension\": [\r\n                        {\r\n                            \"url\": \"https://fhir.by/StructureDefinition/ExtStringValue\",\r\n                            \"valueString\": \"{{codeMrecLocation}}\"\r\n                        }\r\n                    ],\r\n                    \"reference\": \"Location/{{LocationMREC}}\",\r\n                    \"display\": \"{{LocationName}}\"\r\n                },\r\n                \"authorization\": [\r\n                    {\r\n                        \"reference\": {\r\n                            \"reference\": \"ClinicalImpression/ExampleConclusionMREC\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"patient\": {\r\n                    \"reference\": \"Patient/ExamplePatientWithIdentificationNumber\"\r\n                },\r\n                \"agent\": [\r\n                    {\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/AgentTypeProvenance\",\r\n                                    \"code\": \"organization\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"who\": {\r\n                            \"extension\": [\r\n                                {\r\n                                    \"url\": \"https://fhir.by/StructureDefinition/ExtStringValue\",\r\n                                    \"valueString\": \"{{codeMREC}}\"\r\n                                }\r\n                            ],\r\n                            \"reference\": \"Organization/{{OrganizationMREC}}\",\r\n                            \"display\": \"{{OrganizationName}}\"\r\n                        }\r\n                    },\r\n                    {\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/AgentTypeProvenance\",\r\n                                    \"code\": \"practitioner\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"who\": {\r\n                            \"reference\": \"Practitioner/{{PractitionerMREC}}\",\r\n                            \"display\": \"{{PractitionerName}}\"\r\n                        }\r\n                    },\r\n                    {\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/AgentTypeProvenance\",\r\n                                    \"code\": \"practitionerRole\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"who\": {\r\n                            \"reference\": \"PractitionerRole/{{PractitionerRoleMREC}}\",\r\n                            \"display\": \"{{PractitionerRoleName}}\"\r\n                        }\r\n                    }\r\n                ]\r\n            }\r\n        }\r\n    ]\r\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Bundle/$import",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Bundle",
                    "$import"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Метод получения статуса операции импорта пакета медицинской информации",
              "request": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Bundle/{{bundleId}}/$status",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Bundle",
                    "{{bundleId}}",
                    "$status"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Метод проверки наличия у пациента актуальных заключений МРЭК",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "var jsonData = pm.response.json();\r",
                      "let patientId = jsonData.entry.find(obj => obj.resource.resourceType === \"ClinicalImpression\").resource.id;\r",
                      "\r",
                      "pm.collectionVariables.set(\"clinicalImpressionId\", patientId);\r",
                      "console.log(patientId)\r",
                      ""
                    ],
                    "type": "text/javascript",
                    "packages": {}
                  }
                }
              ],
              "request": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient/{{patientId}}/ClinicalImpression?_profile=https://fhir.by/StructureDefinition/ConclusionMREC&status=completed",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient",
                    "{{patientId}}",
                    "ClinicalImpression"
                  ],
                  "query": [
                    {
                      "key": "_profile",
                      "value": "https://fhir.by/StructureDefinition/ConclusionMREC"
                    },
                    {
                      "key": "status",
                      "value": "completed"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Метод проверки наличия у пациента актуальных заключений МРЭК Copy",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "var jsonData = pm.response.json();\r",
                      "let patientId = jsonData.entry.find(obj => obj.resource.resourceType === \"ClinicalImpression\").resource.id;\r",
                      "\r",
                      "pm.collectionVariables.set(\"clinicalImpressionId\", patientId);\r",
                      "console.log(patientId)\r",
                      ""
                    ],
                    "type": "text/javascript",
                    "packages": {}
                  }
                }
              ],
              "request": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient/{{patientId}}/ClinicalImpression?_profile=https://fhir.by/StructureDefinition/ConclusionMREC&status=completed",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient",
                    "{{patientId}}",
                    "ClinicalImpression"
                  ],
                  "query": [
                    {
                      "key": "_profile",
                      "value": "https://fhir.by/StructureDefinition/ConclusionMREC"
                    },
                    {
                      "key": "status",
                      "value": "completed"
                    }
                  ]
                }
              },
              "response": []
            }
          ],
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "packages": {},
                "requests": {},
                "exec": [
                  ""
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "packages": {},
                "requests": {},
                "exec": [
                  ""
                ]
              }
            }
          ]
        },
        {
          "name": "Кейс 4. Пациент в возрасте до 18 лет впервые направлен на медико-социальную экспертизу. Признан инвалидом.  Сформирована индивидуальная программа реабилитации инвалида.",
          "item": [
            {
              "name": "импорт пакета медицинских данных Copy",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Валидный бандл должен отработать со статусом 202\", function () {\r\n    pm.response.to.have.status(202);\r\n});\r\n\r\nvar jsonData = pm.response.json();\r\nlet bundleId = jsonData.parameter.find(obj => obj.name === \"ResourceId\").valueString;\r\nlet statusReference = jsonData.parameter.find(obj => obj.name === \"OperationStatusReference\");\r\n\r\nconsole.log(statusReference.valueReference.reference);\r\n\r\npm.collectionVariables.set(\"bundleId\", bundleId);\r\npm.collectionVariables.set(\"StatusUrl\", statusReference.valueReference.reference);\r\n"
                    ]
                  }
                }
              ],
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Fhir-By-Version",
                    "value": "active"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\r\n                \"resourceType\": \"Patient\",\r\n                \"id\": \"PatientBundleForTest\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/PatientWithIdentificationNumber\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/DisabilityGroup\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/DisabilityGroup\",\r\n                                    \"code\": \"2_grade\",\r\n                                    \"display\": \"2 степень\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/DisabilityReason\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/DisabilityReason\",\r\n                                    \"code\": \"ch-general\",\r\n                                    \"display\": \"вследствие общего заболевания\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    }\r\n                ],\r\n                \"identifier\": [\r\n                    {\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/PersonalDocumentType\",\r\n                                    \"code\": \"INP\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"value\": \"7551309A009PB7\"\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"extension\": [\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/PassportIssuedString\",\r\n                                        \"valueString\": \"Центральным РУВД г Минска\"\r\n                                    },\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/PassportIssuedDate\",\r\n                                        \"valueDate\": \"2020-12-18\"\r\n                                    },\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/PassportIssuedCode\",\r\n                                        \"valueCodeableConcept\": {\r\n                                            \"coding\": [\r\n                                                {\r\n                                                    \"system\": \"https://fhir.by/ValueSet/OCAM\",\r\n                                                    \"code\": \"710\"\r\n                                                }\r\n                                            ]\r\n                                        }\r\n                                    }\r\n                                ],\r\n                                \"url\": \"https://fhir.by/StructureDefinition/PassportIssued\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"usual\",\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/PersonalDocumentType\",\r\n                                    \"code\": \"Passport-RB\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"value\": \"MP8514841\"\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"extension\": [\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/PassportIssuedString\",\r\n                                        \"valueString\": \"Центральным РУВД г Минска, 2024-01-31\"\r\n                                    },\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/PassportIssuedDate\",\r\n                                        \"valueDate\": \"2024-01-31\"\r\n                                    },\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/PassportIssuedCode\",\r\n                                        \"valueCodeableConcept\": {\r\n                                            \"coding\": [\r\n                                                {\r\n                                                    \"system\": \"https://fhir.by/ValueSet/OCAM\",\r\n                                                    \"code\": \"106\"\r\n                                                }\r\n                                            ]\r\n                                        }\r\n                                    }\r\n                                ],\r\n                                \"url\": \"https://fhir.by/StructureDefinition/PassportIssued\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"usual\",\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/PersonalDocumentType\",\r\n                                    \"code\": \"CDP\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"period\": {\r\n                            \"start\": \"2025-09-20\"\r\n                        },\r\n                        \"value\": \"15№ 0103839\",\r\n                        \"assigner\": {\r\n                            \"reference\": \"Organization/{{OrganizationMREC}}\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"active\": true,\r\n                \"name\": [\r\n                    {\r\n                        \"family\": \"Иванов\",\r\n                        \"given\": [\r\n                            \"Сидор\",\r\n                            \"Петрович\"\r\n                        ]\r\n                    }\r\n                ],\r\n                \"telecom\": [\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/PatientTelecomPurpose\",\r\n                                \"extension\": [\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/PatientNotificationType\",\r\n                                        \"valueCodeableConcept\": {\r\n                                            \"coding\": [\r\n                                                {\r\n                                                    \"system\": \"https://fhir.by/ValueSet/PatientNotificationType\",\r\n                                                    \"code\": \"SMS\"\r\n                                                }\r\n                                            ]\r\n                                        }\r\n                                    },\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/PatientConsentForNotification\",\r\n                                        \"valueBoolean\": true\r\n                                    }\r\n                                ]\r\n                            }\r\n                        ],\r\n                        \"system\": \"phone\",\r\n                        \"value\": \"+375295001111\"\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/PatientTelecomPurpose\",\r\n                                \"extension\": [\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/PatientNotificationType\",\r\n                                        \"valueCodeableConcept\": {\r\n                                            \"coding\": [\r\n                                                {\r\n                                                    \"system\": \"https://fhir.by/ValueSet/PatientNotificationType\",\r\n                                                    \"code\": \"e-mail\"\r\n                                                }\r\n                                            ]\r\n                                        }\r\n                                    },\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/PatientConsentForNotification\",\r\n                                        \"valueBoolean\": true\r\n                                    }\r\n                                ]\r\n                            }\r\n                        ],\r\n                        \"system\": \"email\",\r\n                        \"value\": \"Ivanov@gmail.com\"\r\n                    }\r\n                ],\r\n                \"gender\": \"male\",\r\n                \"birthDate\": \"2017-12-31\",\r\n                \"deceasedBoolean\": false,\r\n                \"address\": [\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                            \"version\": \"1.51\",\r\n                                            \"code\": \"BY\",\r\n                                            \"display\": \"Беларусь\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                            \"version\": \"1.3\",\r\n                                            \"code\": \"2938771891184418\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                                \"valueString\": \"кв. 101\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"home\",\r\n                        \"text\": \"Витебская область, г. Витебск, Улица 19-я Городокская, д. 522\"\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                            \"version\": \"1.51\",\r\n                                            \"code\": \"BY\",\r\n                                            \"display\": \"Беларусь\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                            \"version\": \"1.3\",\r\n                                            \"code\": \"12463236041049757\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                                \"valueString\": \"кв. 1201\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"temp\",\r\n                        \"text\": \"Брестская область, г. Пинск, Улица Центральная, д. 9\"\r\n                    }\r\n                ]\r\n            }",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "поиск пациента по идентификационному номеру",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "var jsonData = pm.response.json();\r",
                      "let patientId = jsonData.entry.find(obj => obj.resource.resourceType === \"Patient\").resource.id;\r",
                      "\r",
                      "pm.collectionVariables.set(\"patientId\", patientId);\r",
                      "console.log(patientId)\r",
                      ""
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "protocolProfileBehavior": {
                "disableBodyPruning": true
              },
              "request": {
                "method": "GET",
                "header": [],
                "body": {
                  "mode": "raw",
                  "raw": "",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient?identifier=7551309A009PB7",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient"
                  ],
                  "query": [
                    {
                      "key": "identifier",
                      "value": "7551309A009PB7"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Метод получения идентификатора электронного документа",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "var jsonData = pm.response.json();\r",
                      "let identifier = jsonData.parameter.find(obj => obj.name === \"identifier\").valueString;\r",
                      "pm.collectionVariables.set(\"identifier\", identifier);\r",
                      "console.log(identifier)"
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "request": {
                "method": "POST",
                "header": [],
                "body": {
                  "mode": "raw",
                  "raw": "{\r\n\"resourceType\" : \"Parameters\",\r\n\"parameter\" : [{\r\n    \"name\" : \"document-code\",\r\n    \"valueCoding\" : {\r\n        \"system\": \"https://fhir.by/ValueSet/DigitalDocumentKind\",\r\n        \"code\": \"04\"\r\n    }\r\n}]\r\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/$get-document-id",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "$get-document-id"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "импорт пакета медицинских данных",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Валидный бандл должен отработать со статусом 202\", function () {\r\n    pm.response.to.have.status(202);\r\n});\r\n\r\nvar jsonData = pm.response.json();\r\nlet bundleId = jsonData.parameter.find(obj => obj.name === \"ResourceId\").valueString;\r\nlet statusReference = jsonData.parameter.find(obj => obj.name === \"OperationStatusReference\");\r\n\r\nconsole.log(statusReference.valueReference.reference);\r\n\r\npm.collectionVariables.set(\"bundleId\", bundleId);\r\npm.collectionVariables.set(\"StatusUrl\", statusReference.valueReference.reference);\r\n"
                    ]
                  }
                }
              ],
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Fhir-By-Version",
                    "value": "active"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\r\n    \"resourceType\": \"Bundle\",\r\n    \"id\": \"BundleForTest\",\r\n    \"meta\": {\r\n        \"profile\": [\r\n            \"https://fhir.by/AbstractArea/StructureDefinition/Bundle/MedicationDocument\"\r\n        ]\r\n    },\r\n    \"identifier\": {\r\n        \"system\": \"https://fhir.by/ValueSet/urn:ietf:rfc:3986\",\r\n        \"value\": \"urn:uuid:0c3151bd-1cbf-4d64-b04d-{{$guid}}\"\r\n    },\r\n    \"type\": \"document\",\r\n    \"timestamp\": \"2024-04-07T11:30:00Z\",\r\n    \"entry\": [\r\n        {\r\n            \"fullUrl\": \"Composition/CompositionBundleForTest\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Composition\",\r\n                \"id\": \"{{$guid}}\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/CompDocument\"\r\n                    ]\r\n                },\r\n                \"status\": \"registered\",\r\n                \"type\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/CompositionType\",\r\n                            \"code\": \"general\",\r\n                            \"display\": \"Общая медицинская информация\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"subject\": [\r\n                    {\r\n                        \"reference\": \"Patient/PatientBundleForTest\"\r\n                    }\r\n                ],\r\n                \"date\": \"2024-04-07T11:12:21Z\",\r\n                \"author\": [\r\n                    {\r\n                        \"reference\": \"Practitioner/{{PractitionerMREC}}\"\r\n                    }\r\n                ],\r\n                \"title\": \"CompDocument для наполненного Bundle\",\r\n                \"custodian\": {\r\n                    \"reference\": \"Organization/{{OrganizationMREC}}\"\r\n                }\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Patient/PatientBundleForTest\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Patient\",\r\n                \"id\": \"ExamplePatientWithIdentificationNumber\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/PatientED\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/DocumentKind\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/DigitalDocumentKind\",\r\n                                    \"code\": \"00\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    }\r\n                ],\r\n                \"identifier\": [\r\n                    {\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/PersonalDocumentType\",\r\n                                    \"code\": \"INP\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"value\": \"7551309A009PB7\"\r\n                    }\r\n                ],\r\n                \"active\": true,\r\n                \"name\": [\r\n                    {\r\n                        \"family\": \"Иванов\",\r\n                        \"given\": [\r\n                            \"Сидор\",\r\n                            \"Петрович\"\r\n                        ]\r\n                    }\r\n                ],\r\n                \"birthDate\": \"2017-12-31\",\r\n                \"gender\": \"male\",\r\n                \"telecom\": [\r\n                    {\r\n                        \"system\": \"phone\",\r\n                        \"value\": \"+375291112233\"\r\n                    }\r\n                ],\r\n                \"address\": [\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                            \"version\": \"1.51\",\r\n                                            \"code\": \"BY\",\r\n                                            \"display\": \"Беларусь\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                            \"version\": \"1.3\",\r\n                                            \"code\": \"2938771891184418\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                                \"valueString\": \"кв. 101\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"home\",\r\n                        \"text\": \"Витебская область, г. Витебск, Улица 19-я Городокская, д. 5\"\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                            \"version\": \"1.51\",\r\n                                            \"code\": \"BY\",\r\n                                            \"display\": \"Беларусь\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                            \"version\": \"1.3\",\r\n                                            \"code\": \"12463236041049757\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                                \"valueString\": \"кв. 1201\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"temp\",\r\n                        \"text\": \"Брестская область, г. Пинск, Улица Центральная, д. 9\"\r\n                    }\r\n                ],\r\n                \"link\": [\r\n                    {\r\n                        \"other\": {\r\n                            \"reference\": \"Patient/{{patientId}}\"\r\n                        },\r\n                        \"type\": \"refer\"\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Encounter/EncounterBundleForTest\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Encounter\",\r\n                \"id\": \"ExampleEncounterForMREC\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/EncounterGeneral\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/EncouterMRECConcent\",\r\n                        \"valueBoolean\": true\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/DisabilityFirstTime\",\r\n                        \"valueBoolean\": true\r\n                    }\r\n                ],\r\n                \"identifier\": [\r\n                    {\r\n                        \"value\": \"665\",\r\n                        \"assigner\": {\r\n                            \"reference\": \"Organization/{{OrganizationMREC}}\",\r\n                            \"display\": \"Учреждение здравоохранения \\\"Витебская областная медико-реабилитационная экспертная комиссия\\\"\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"status\": \"completed\",\r\n                \"class\": [\r\n                    {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/VSTermsOfService\",\r\n                                \"code\": \"1\"\r\n                            }\r\n                        ]\r\n                    }\r\n                ],\r\n                \"priority\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/HealthCareForms\",\r\n                            \"code\": \"planned\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"type\": [\r\n                    {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/TypeOfHealthCare\",\r\n                                \"code\": \"special\"\r\n                            }\r\n                        ]\r\n                    }\r\n                ],\r\n                \"subject\": {\r\n                    \"reference\": \"Patient/{{patientId}}\",\r\n                    \"display\": \"Иванов Сидор Петрович\"\r\n                },\r\n                \"serviceProvider\": {\r\n                    \"reference\": \"Organization/{{OrganizationMREC}}\"\r\n                },\r\n                \"participant\": [\r\n                    {\r\n                        \"actor\": {\r\n                            \"reference\": \"PractitionerRole/{{PractitionerRoleMREC}}\",\r\n                            \"display\": \"Иванов Владислав Эдуардович\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"actualPeriod\": {\r\n                    \"start\": \"2024-09-01T12:00:00Z\",\r\n                    \"end\": \"2024-09-01T12:15:00Z\"\r\n                },\r\n                \"diagnosis\": [\r\n                    {\r\n                        \"condition\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"Condition/ExampleDiagnosisMREC\"\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"use\": [\r\n                            {\r\n                                \"coding\": [\r\n                                    {\r\n                                        \"system\": \"https://fhir.by/ValueSet/TypeOfDiagnosis\",\r\n                                        \"code\": \"mainDiagnosis\"\r\n                                    }\r\n                                ]\r\n                            }\r\n                        ]\r\n                    }\r\n                ],\r\n                \"location\": [\r\n                    {\r\n                        \"location\": {\r\n                            \"reference\": \"Location/{{LocationMREC}}\"\r\n                        }\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Condition/ExampleDiagnosisMREC\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Condition\",\r\n                \"id\": \"ExampleDiagnosisMREC\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/FinalDiagnosis\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/KindOfDiagnosis\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/KindOfDiagnosisCode\",\r\n                                    \"code\": \"Сlinical-functional\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/AssertedDate\",\r\n                        \"valueDateTime\": \"2024-09-01\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/FirstTimeRevealed\",\r\n                        \"valueBoolean\": true\r\n                    }\r\n                ],\r\n                \"clinicalStatus\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"http://terminology.hl7.org/CodeSystem/condition-clinical\",\r\n                            \"code\": \"active\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"code\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/InternClassificDiseases10\",\r\n                            \"code\": \"H52.1\",\r\n                            \"display\": \"Миопия\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"subject\": {\r\n                    \"reference\": \"Patient/{{patientId}}\"\r\n                },\r\n                \"onsetDateTime\": \"2024-09-01\",\r\n                \"recordedDate\": \"2024-09-01\",\r\n                \"participant\": [\r\n                    {\r\n                        \"actor\": {\r\n                            \"reference\": \"PractitionerRole/{{PractitionerRoleMREC}}\",\r\n                            \"display\": \"Иванов Владислав Эдуардович\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"note\": [\r\n                    {\r\n                        \"text\": \"Миопия. Тяжелой степени\"\r\n                    }\r\n                ]\r\n            }\r\n        }\r\n    ]\r\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Bundle/$import",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Bundle",
                    "$import"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "получение статуса импорта пакета медицинских данных",
              "request": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Bundle/{{bundleId}}/$status",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Bundle",
                    "{{bundleId}}",
                    "$status"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "поиск пациента по идентификационному номеру",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "var jsonData = pm.response.json();\r",
                      "let patientId = jsonData.entry.find(obj => obj.resource.resourceType === \"Patient\").resource.id;\r",
                      "\r",
                      "pm.collectionVariables.set(\"patientId\", patientId);\r",
                      "console.log(patientId)\r",
                      ""
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "protocolProfileBehavior": {
                "disableBodyPruning": true
              },
              "request": {
                "method": "GET",
                "header": [],
                "body": {
                  "mode": "raw",
                  "raw": "",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient?identifier=7551309A009PB7",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient"
                  ],
                  "query": [
                    {
                      "key": "identifier",
                      "value": "7551309A009PB7"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Поиск обращения пациента к врачу",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "var jsonData = pm.response.json();\r",
                      "\r",
                      "// Фильтруем только Encounter ресурсы, исключая OperationOutcome\r",
                      "let encounterEntries = jsonData.entry.filter(entry => \r",
                      "    entry.resource && entry.resource.resourceType === \"Encounter\"\r",
                      ");\r",
                      "\r",
                      "if (encounterEntries.length > 0) {\r",
                      "    // Сортируем по дате lastUpdated (от новых к старым) и берем самый свежий\r",
                      "    encounterEntries.sort((a, b) => \r",
                      "        new Date(b.resource.meta.lastUpdated) - new Date(a.resource.meta.lastUpdated)\r",
                      "    );\r",
                      "    \r",
                      "    let latestEncounter = encounterEntries[0];\r",
                      "    let encounterId = latestEncounter.resource.id;\r",
                      "    pm.collectionVariables.set(\"encounterId\", encounterId);\r",
                      "    console.log(\"Latest encounterId:\", encounterId);\r",
                      "    console.log(\"Last updated:\", latestEncounter.resource.meta.lastUpdated);\r",
                      "} else {\r",
                      "    console.log(\"No Encounter resources found in response\");\r",
                      "}\r",
                      ""
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "protocolProfileBehavior": {
                "disableBodyPruning": true
              },
              "request": {
                "method": "GET",
                "header": [],
                "body": {
                  "mode": "raw",
                  "raw": "",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient/{{patientId}}/Encounter?_profile=https://fhir.by/StructureDefinition/EncounterGeneral&patient={{patientId}}&_sort=-_lastUpdated",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient",
                    "{{patientId}}",
                    "Encounter"
                  ],
                  "query": [
                    {
                      "key": "_profile",
                      "value": "https://fhir.by/StructureDefinition/EncounterGeneral"
                    },
                    {
                      "key": "patient",
                      "value": "{{patientId}}"
                    },
                    {
                      "key": "_sort",
                      "value": "-_lastUpdated"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Поиск диагноза пациента к врачу",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "var jsonData = pm.response.json();\r",
                      "let patientId = jsonData.entry.find(obj => obj.resource.resourceType === \"Patient\").resource.id;\r",
                      "\r",
                      "pm.collectionVariables.set(\"patientId\", patientId);\r",
                      "console.log(patientId)\r",
                      ""
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "protocolProfileBehavior": {
                "disableBodyPruning": true
              },
              "request": {
                "method": "GET",
                "header": [],
                "body": {
                  "mode": "raw",
                  "raw": "",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient/{{patientId}}/Condition?_profile=https://fhir.by/StructureDefinition/FinalDiagnosis&_sort=-_lastUpdated",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient",
                    "{{patientId}}",
                    "Condition"
                  ],
                  "query": [
                    {
                      "key": "_profile",
                      "value": "https://fhir.by/StructureDefinition/FinalDiagnosis"
                    },
                    {
                      "key": "_sort",
                      "value": "-_lastUpdated"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Метод проверки отсутствия у пациента актуальных заключений МРЭК",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      ""
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "request": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient/{{patientId}}/ClinicalImpression?_profile=https://fhir.by/StructureDefinition/ConclusionMREC&status=completed",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient",
                    "{{patientId}}",
                    "ClinicalImpression"
                  ],
                  "query": [
                    {
                      "key": "_profile",
                      "value": "https://fhir.by/StructureDefinition/ConclusionMREC"
                    },
                    {
                      "key": "status",
                      "value": "completed"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Метод проверка отсутствия у пациента актуальных индивидуальных программ реабилитации",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      ""
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "protocolProfileBehavior": {
                "disableBodyPruning": true
              },
              "request": {
                "method": "GET",
                "header": [],
                "body": {
                  "mode": "raw",
                  "raw": "",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient/{{patientId}}/CarePlan?_profile=https://fhir.by/StructureDefinition/IPR&status=active",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient",
                    "{{patientId}}",
                    "CarePlan"
                  ],
                  "query": [
                    {
                      "key": "_profile",
                      "value": "https://fhir.by/StructureDefinition/IPR"
                    },
                    {
                      "key": "status",
                      "value": "active"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Метод импорта пакета медицинской информации (заключение МРЭК)",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "pm.test(\"Валидный бандл должен отработать со статусом 202\", function () {\r",
                      "    pm.response.to.have.status(202);\r",
                      "});\r",
                      "\r",
                      "var jsonData = pm.response.json();\r",
                      "let bundleId = jsonData.parameter.find(obj => obj.name === \"ResourceId\").valueString;\r",
                      "let statusReference = jsonData.parameter.find(obj => obj.name === \"OperationStatusReference\");\r",
                      "\r",
                      "console.log(statusReference.valueReference.reference);\r",
                      "\r",
                      "pm.collectionVariables.set(\"bundleId\", bundleId);\r",
                      "pm.collectionVariables.set(\"StatusUrl\", statusReference.valueReference.reference);\r",
                      ""
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Fhir-By-Version",
                    "value": "active",
                    "type": "text"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\r\n    \"resourceType\": \"Bundle\",\r\n    \"id\": \"BundleConclusionMRECDisability190110\",\r\n    \"meta\": {\r\n        \"profile\": [\r\n            \"https://fhir.by/AbstractArea/StructureDefinition/Bundle/BundleMREC\"\r\n        ]\r\n    },\r\n    \"identifier\": {\r\n        \"system\": \"https://minzdrav.gov.by\",\r\n        \"value\": \"{{identifier}}\"\r\n    },\r\n    \"type\": \"document\",\r\n    \"timestamp\": \"2024-09-01T11:12:21Z\",\r\n    \"entry\": [\r\n        {\r\n            \"fullUrl\": \"Composition/ExampleCompositionMRECDisability\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Composition\",\r\n                \"id\": \"ExampleCompositionMRECDisability\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/DocumentMREC\"\r\n                    ]\r\n                },\r\n                \"status\": \"final\",\r\n                \"type\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/CompositionType\",\r\n                            \"code\": \"conclusion-mrec\",\r\n                            \"display\": \"Заключение МРЭК\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"subject\": [\r\n                    {\r\n                        \"reference\": \"Patient/ExamplePatientWithIdentificationNumber\"\r\n                    }\r\n                ],\r\n                \"date\": \"2024-09-01T11:12:21Z\",\r\n                \"author\": [\r\n                    {\r\n                        \"reference\": \"Practitioner/{{PractitionerMREC}}\"\r\n                    }\r\n                ],\r\n                \"title\": \"Уточненный состав необходимых данных о лице, предоставляемых медико-реабилитационными экспертными комиссиями\",\r\n                \"custodian\": {\r\n                    \"reference\": \"Organization/{{OrganizationMREC}}\"\r\n                },\r\n                \"event\": [\r\n                    {\r\n                        \"detail\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"ClinicalImpression/ExampleConclusionMREC\"\r\n                                }\r\n                            }\r\n                        ]\r\n                    },\r\n                    \r\n                    {\r\n                        \"detail\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"CarePlan/ExampleIPR\"\r\n                                }\r\n                            }\r\n                        ]\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Patient/ExamplePatientWithIdentificationNumber\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Patient\",\r\n                \"id\": \"ExamplePatientWithIdentificationNumber\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/PatientED\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/DocumentKind\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/DigitalDocumentKind\",\r\n                                    \"code\": \"04\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    }\r\n                ],\r\n                \"identifier\": [\r\n                    {\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/PersonalDocumentType\",\r\n                                    \"code\": \"INP\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"value\": \"7551309A009PB7\"\r\n                    }\r\n                ],\r\n                \"active\": true,\r\n                \"name\": [\r\n                    {\r\n                        \"family\": \"Иванов\",\r\n                        \"given\": [\r\n                            \"Сидор\",\r\n                            \"Петрович\"\r\n                        ]\r\n                    }\r\n                ],\r\n                \"birthDate\": \"2017-12-31\",\r\n                \"telecom\": [\r\n                    {\r\n                        \"system\": \"phone\",\r\n                        \"value\": \"+375291112233\"\r\n                    }\r\n                ],\r\n                \"contact\": [\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ContactIdentifierNumber\",\r\n                                \"valueString\": \"7001112A009PB3\"\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ContactBirthDate\",\r\n                                \"valueDate\": \"1990-12-31\"\r\n                            }\r\n                        ],\r\n                        \"name\": {\r\n                            \"family\": \"Иванова\",\r\n                            \"given\": [\r\n                                \"Ирина\",\r\n                                \"Васильевна\"\r\n                            ]\r\n                        },\r\n                        \"telecom\": [\r\n                            {\r\n                                \"system\": \"phone\",\r\n                                \"value\": \"+375175552233\"\r\n                            }\r\n                        ],\r\n                        \"address\": {\r\n                            \"extension\": [\r\n                                {\r\n                                    \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                                    \"valueCodeableConcept\": {\r\n                                        \"coding\": [\r\n                                            {\r\n                                                \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                                \"code\": \"BY\",\r\n                                                \"display\": \"Беларусь\"\r\n                                            }\r\n                                        ]\r\n                                    }\r\n                                },\r\n                                {\r\n                                    \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                                    \"valueCodeableConcept\": {\r\n                                        \"coding\": [\r\n                                            {\r\n                                                \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                                \"code\": \"72609920778\",\r\n                                                \"display\": \"Переулок Снежный\"\r\n                                            }\r\n                                        ]\r\n                                    }\r\n                                },\r\n                                {\r\n                                    \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                                    \"valueString\": \"кв. 11\"\r\n                                }\r\n                            ],\r\n                            \"text\": \"Могилевская область, г.Могилев, Переулок Гоголя, д.19\",\r\n                            \"postalCode\": \"212011\"\r\n                        },\r\n                        \"gender\": \"female\"\r\n                    }\r\n                ],\r\n                \"address\": [\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                            \"version\": \"1.51\",\r\n                                            \"code\": \"BY\",\r\n                                            \"display\": \"Беларусь\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                            \"version\": \"1.3\",\r\n                                            \"code\": \"2938771891184418\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                                \"valueString\": \"кв. 101\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"home\",\r\n                        \"text\": \"Витебская область, г. Витебск, Улица 19-я Городокская, д. 5\"\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                            \"version\": \"1.51\",\r\n                                            \"code\": \"BY\",\r\n                                            \"display\": \"Беларусь\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                            \"version\": \"1.3\",\r\n                                            \"code\": \"12463236041049757\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                                \"valueString\": \"кв. 1201\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"temp\",\r\n                        \"text\": \"Брестская область, г. Пинск, Улица Центральная, д. 9\"\r\n                    }\r\n                ],\r\n                \"link\": [\r\n                    {\r\n                        \"other\": {\r\n                            \"reference\": \"Patient/{{patientId}}\"\r\n                        },\r\n                        \"type\": \"refer\"\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"ClinicalImpression/ExampleConclusionMREC\",\r\n            \"resource\": {\r\n                \"resourceType\": \"ClinicalImpression\",\r\n                \"id\": \"ExampleConclusionMREC\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/ConclusionMREC\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CodesReasonForMREC\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/ReasonForMREC\",\r\n                                            \"code\": \"definition-disability\",\r\n                                            \"display\": \"освидетельствование  пациента\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"url\": \"https://fhir.by/StructureDefinition/ReasonForMREC\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/ExtSurveyTypeMREC\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/SurveyTypeMREC\",\r\n                                    \"code\": \"1\",\r\n                                    \"display\": \"первичное очное\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/DisabilityCertificate\",\r\n                        \"valueIdentifier\": {\r\n                            \"value\": \"12№ 1003839\",\r\n                            \"period\": {\r\n                                \"start\": \"2024-09-20\",\r\n                                \"end\": \"2025-09-20\"\r\n                            },\r\n                            \"assigner\": {\r\n                                \"reference\": \"Organization/{{OrganizationMREC}}\"\r\n                            }\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/DisabilityGroup\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/DisabilityGroup\",\r\n                                    \"code\": \"2_grade\",\r\n                                    \"display\": \"2 степень\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/DisabilityReason\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/DisabilityReason\",\r\n                                    \"code\": \"ch-general\",\r\n                                    \"display\": \"вследствие общего заболевания\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/AdditionalTypesOfHelp\",\r\n                        \"valueString\": \"не нуждается в постоянной помощи\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/AdditionalTypesOfCare\",\r\n                        \"valueString\": \"не нуждается в постоянном уходе\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/AdditionalForConclusionMREC\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/AdditionalForConclusionMREC\",\r\n                                    \"code\": \"absens\",\r\n                                    \"display\": \"отсутствует\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/ProgramRehabilitionMREC\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/ProgramRehabilitionMREC\",\r\n                                    \"code\": \"ipra-child\",\r\n                                    \"display\": \"индивидуальная программа реабилитации, абилитации ребенка-инвалида\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    }\r\n                ],\r\n                \"encounter\": {\r\n                    \"reference\": \"Encounter/{{encounterId}}\"\r\n                },\r\n                \"identifier\": [\r\n                    {\r\n                        \"value\": \"{{identifier}}\",\r\n                        \"period\": {\r\n                            \"start\": \"2024-09-20\",\r\n                            \"end\": \"2025-09-20\"\r\n                        },\r\n                        \"assigner\": {\r\n                            \"extension\": [\r\n                                {\r\n                                    \"url\": \"https://fhir.by/StructureDefinition/LocationReference\",\r\n                                    \"valueReference\": {\r\n                                        \"reference\": \"Location/{{LocationMREC}}\"\r\n                                    }\r\n                                }\r\n                            ],\r\n                            \"reference\": \"Organization/{{OrganizationMREC}}\",\r\n                            \"display\": \"Учреждение здравоохранения \\\"Витебская областная медико-реабилитационная экспертная комиссия\\\"\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"status\": \"completed\",\r\n                \"description\": \"Заключение МРЭК №{{identifier}}, Иванов Сидор Петрович, 31.12.2017\",\r\n                \"subject\": {\r\n                    \"reference\": \"Patient/ExamplePatientWithIdentificationNumber\"\r\n                },\r\n                \"effectiveDateTime\": \"2024-09-20\",\r\n                \"date\": \"2024-09-20\",\r\n                \"performer\": {\r\n                    \"reference\": \"PractitionerRole/{{PractitionerRoleMREC}}\"\r\n                }\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"CarePlan/ExampleIPR\",\r\n            \"resource\": {\r\n                \"resourceType\": \"CarePlan\",\r\n                \"id\": \"ExampleIPR\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/IPR\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/AdditionalForConclusionMREC\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/AdditionalForConclusionMREC\",\r\n                                    \"code\": \"absens\",\r\n                                    \"display\": \"отсутствует\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/ReferredInitially\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/RehabProgramm\",\r\n                                    \"code\": \"first\",\r\n                                    \"display\": \"впервые\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/ReferenceToConclusionMREC\",\r\n                        \"valueReference\": {\r\n                            \"reference\": \"ClinicalImpression/ExampleConclusionMREC\"\r\n                        }\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/DisorderCode\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/DisordersFunctionAndSystem\",\r\n                                            \"code\": \"sensordisf\",\r\n                                            \"display\": \"нарушения сенсорных функций (зрения, слуха, обоняния, осязания, тактильной, болевой, температурной, вибрационной и других видов чувствительности)\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/DisorderGrade\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/DegreesOfManifestationOfDisfunctions\",\r\n                                            \"code\": \"expressed\",\r\n                                            \"display\": \"выраженные\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"url\": \"https://fhir.by/StructureDefinition/ExtDisordersFunctionAndSystem\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/SpecialtyMREC\",\r\n                        \"valueString\": \"маляр-штукатур\"\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/PatientStudyPlace\",\r\n                                \"valueString\": \"Средняя школа №75 г. Минска\"\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/PatientStudyKind\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/EducationKind\",\r\n                                            \"code\": \"pupil\",\r\n                                            \"display\": \"ученик\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/PatientTermOfStudy\",\r\n                                \"valuePeriod\": {\r\n                                    \"start\": \"2024-09-01\"\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"url\": \"https://fhir.by/StructureDefinition/PatientStudy\"\r\n                    }\r\n                ],\r\n                \"identifier\": [\r\n                    {\r\n                        \"value\": \"{{identifier}}\",\r\n                        \"assigner\": {\r\n                            \"extension\": [\r\n                                {\r\n                                    \"url\": \"https://fhir.by/StructureDefinition/LocationReference\",\r\n                                    \"valueReference\": {\r\n                                        \"reference\": \"Location/{{LocationMREC}}\"\r\n                                    }\r\n                                }\r\n                            ],\r\n                            \"reference\": \"Organization/{{OrganizationMREC}}\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"period\": {\r\n                    \"start\": \"2024-09-20\",\r\n                    \"end\": \"2025-09-20\"\r\n                },\r\n                \"basedOn\": [\r\n                    {\r\n                        \"identifier\": {\r\n                            \"value\": \"{{identifier}}\",\r\n                            \"period\": {\r\n                                \"start\": \"2024-09-20\"\r\n                            }\r\n                        }\r\n                    }\r\n                ],\r\n                \"status\": \"active\",\r\n                \"intent\": \"plan\",\r\n                \"title\": \"Программа реабилитации инвалида\",\r\n                \"subject\": {\r\n                    \"reference\": \"Patient/ExamplePatientWithIdentificationNumber\"\r\n                },\r\n                \"created\": \"2024-09-20\",\r\n                \"custodian\": {\r\n                    \"reference\": \"Organization/{{OrganizationMREC}}\"\r\n                },\r\n                \"contributor\": [\r\n                    {\r\n                        \"reference\": \"PractitionerRole/{{PractitionerRoleMREC}}\",\r\n                        \"display\": \"Председатель МРЭК\"\r\n                    }\r\n                ],\r\n                \"addresses\": [\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ActivitiesLoss\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/FunctionalClass\",\r\n                                            \"code\": \"2\",\r\n                                            \"display\": \"Функциональный класс II\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"concept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/RestrictCategoriesActivity\",\r\n                                    \"code\": \"abletoselfcare\",\r\n                                    \"display\": \"Способность к самообслуживанию.\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ActivitiesLoss\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/FunctionalClass\",\r\n                                            \"code\": \"3\",\r\n                                            \"display\": \"Функциональный класс III.\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"concept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/RestrictCategoriesActivity\",\r\n                                    \"code\": \"abletoorientate\",\r\n                                    \"display\": \"Способность к ориентации.\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    }\r\n                ],\r\n                \"activity\": [\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"extension\": [\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/MedicalRehabilitationEventCode\",\r\n                                        \"valueCodeableConcept\": {\r\n                                            \"coding\": [\r\n                                                {\r\n                                                    \"system\": \"https://fhir.by/ValueSet/RehubActivities\",\r\n                                                    \"code\": \"complex\",\r\n                                                    \"display\": \"Предоставление комплекса услуг медицинской реабилитации, абилитации\"\r\n                                                }\r\n                                            ]\r\n                                        }\r\n                                    },\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/RehabilitationEventNeediness\",\r\n                                        \"valueCodeableConcept\": {\r\n                                            \"coding\": [\r\n                                                {\r\n                                                    \"system\": \"https://fhir.by/ValueSet/Neediness\",\r\n                                                    \"code\": \"need\",\r\n                                                    \"display\": \"нуждается\"\r\n                                                }\r\n                                            ]\r\n                                        }\r\n                                    },\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/RehabilitationEventPeriod\",\r\n                                        \"valuePeriod\": {\r\n                                            \"start\": \"2024-01-05\",\r\n                                            \"end\": \"2024-04-05\"\r\n                                        }\r\n                                    }\r\n                                ],\r\n                                \"url\": \"https://fhir.by/StructureDefinition/MedicalRehabilitationEvent\"\r\n                            }\r\n                        ],\r\n                        \"progress\": [\r\n                            {\r\n                                \"text\": \"Поликлиника №15 в течение месяца \"\r\n                            }\r\n                        ]\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"extension\": [\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/MedicalRehabilitationEventCode\",\r\n                                        \"valueCodeableConcept\": {\r\n                                            \"coding\": [\r\n                                                {\r\n                                                    \"system\": \"https://fhir.by/ValueSet/RehubActivities\",\r\n                                                    \"code\": \"technicalrehabmeans\",\r\n                                                    \"display\": \"Обеспечение техническими средствами социальной реабилитации государственными организациями здравоохранения\"\r\n                                                }\r\n                                            ]\r\n                                        }\r\n                                    },\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/RehabilitationEventNeediness\",\r\n                                        \"valueCodeableConcept\": {\r\n                                            \"coding\": [\r\n                                                {\r\n                                                    \"system\": \"https://fhir.by/ValueSet/Neediness\",\r\n                                                    \"code\": \"need\",\r\n                                                    \"display\": \"нуждается\"\r\n                                                }\r\n                                            ]\r\n                                        }\r\n                                    },\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/RehabilitationEventPeriod\",\r\n                                        \"valuePeriod\": {\r\n                                            \"start\": \"2024-01-05\",\r\n                                            \"end\": \"2024-04-05\"\r\n                                        }\r\n                                    }\r\n                                ],\r\n                                \"url\": \"https://fhir.by/StructureDefinition/MedicalRehabilitationEvent\"\r\n                            }\r\n                        ],\r\n                        \"progress\": [\r\n                            {\r\n                                \"text\": \"Поликлиника №15 в течение месяца \"\r\n                            }\r\n                        ]\r\n                    }\r\n                    // {\r\n                    //     \"extension\": [\r\n                    //         {\r\n                    //             \"extension\": [\r\n                    //                 {\r\n                    //                     \"url\": \"https://fhir.by/StructureDefinition/SocialRehabilitationEventCode\",\r\n                    //                     \"valueCodeableConcept\": {\r\n                    //                         \"coding\": [\r\n                    //                             {\r\n                    //                                 \"system\": \"https://fhir.by/ValueSet/SocRehab\",\r\n                    //                                 \"code\": \"psychohelp\",\r\n                    //                                 \"display\": \"Психологическая помощь\"\r\n                    //                             }\r\n                    //                         ]\r\n                    //                     }\r\n                    //                 },\r\n                    //                 {\r\n                    //                     \"url\": \"https://fhir.by/StructureDefinition/RehabilitationEventNeediness\",\r\n                    //                     \"valueCodeableConcept\": {\r\n                    //                         \"coding\": [\r\n                    //                             {\r\n                    //                                 \"system\": \"https://fhir.by/ValueSet/Neediness\",\r\n                    //                                 \"code\": \"need\",\r\n                    //                                 \"display\": \"нуждается\"\r\n                    //                             }\r\n                    //                         ]\r\n                    //                     }\r\n                    //                 },\r\n                    //                 {\r\n                    //                     \"url\": \"https://fhir.by/StructureDefinition/RehabilitationEventString\",\r\n                    //                     \"valueString\": \"Другие методы реабилитации или ТССР\"\r\n                    //                 },\r\n                    //                 {\r\n                    //                     \"url\": \"https://fhir.by/StructureDefinition/RehabilitationEventPeriod\",\r\n                    //                     \"valuePeriod\": {\r\n                    //                         \"start\": \"2024-09-20\"\r\n                    //                     }\r\n                    //                 }\r\n                    //             ],\r\n                    //             \"url\": \"https://fhir.by/StructureDefinition/SocialRehabilitationEvent\"\r\n                    //         },\r\n                    //         {\r\n                    //             \"extension\": [\r\n                    //                 {\r\n                    //                     \"url\": \"https://fhir.by/StructureDefinition/SocialRehabilitationEventCode\",\r\n                    //                     \"valueCodeableConcept\": {\r\n                    //                         \"coding\": [\r\n                    //                             {\r\n                    //                                 \"system\": \"https://fhir.by/ValueSet/SocRehab\",\r\n                    //                                 \"code\": \"socialadaptation\",\r\n                    //                                 \"display\": \"Социально-бытовая реабилитация, социально-бытовая абилитация\"\r\n                    //                             }\r\n                    //                         ]\r\n                    //                     }\r\n                    //                 },\r\n                    //                 {\r\n                    //                     \"url\": \"https://fhir.by/StructureDefinition/RehabilitationEventNeediness\",\r\n                    //                     \"valueCodeableConcept\": {\r\n                    //                         \"coding\": [\r\n                    //                             {\r\n                    //                                 \"system\": \"https://fhir.by/ValueSet/Neediness\",\r\n                    //                                 \"code\": \"need\",\r\n                    //                                 \"display\": \"нуждается\"\r\n                    //                             }\r\n                    //                         ]\r\n                    //                     }\r\n                    //                 },\r\n                    //                 {\r\n                    //                     \"url\": \"https://fhir.by/StructureDefinition/RehabilitationEventString\",\r\n                    //                     \"valueString\": \"Другие методы реабилитации или ТССР\"\r\n                    //                 },\r\n                    //                 {\r\n                    //                     \"url\": \"https://fhir.by/StructureDefinition/RehabilitationEventPeriod\",\r\n                    //                     \"valuePeriod\": {\r\n                    //                         \"start\": \"2024-09-20\"\r\n                    //                     }\r\n                    //                 }\r\n                    //             ],\r\n                    //             \"url\": \"https://fhir.by/StructureDefinition/SocialRehabilitationEvent\"\r\n                    //         }\r\n                    //     ],\r\n                    //     \"progress\": [\r\n                    //         {\r\n                    //             \"text\": \"Поликлиника №15\"\r\n                    //         }\r\n                    //     ]\r\n                    // }\r\n                ],\r\n                \"note\": [\r\n                    {\r\n                        \"text\": \"Текстовое содержимое аннотации\"\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Provenance/ExampleProvenanceDocumentInfoMRECDisability\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Provenance\",\r\n                \"id\": \"ExampleProvenanceDocumentInfoMRECDisability\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/ProvenanceDocumentInfoMREC\"\r\n                    ]\r\n                },\r\n                \"target\": [\r\n                    {\r\n                        \"reference\": \"Patient/ExamplePatientWithIdentificationNumber\"\r\n                    }\r\n                ],\r\n                \"recorded\": \"2024-09-20T11:12:21Z\",\r\n                \"location\": {\r\n                    \"extension\": [\r\n                        {\r\n                            \"url\": \"https://fhir.by/StructureDefinition/ExtStringValue\",\r\n                            \"valueString\": \"{{codeMrecLocation}}\"\r\n                        }\r\n                    ],\r\n                    \"reference\": \"Location/{{LocationMREC}}\",\r\n                    \"display\": \"{{LocationName}}\"\r\n                },\r\n                \"authorization\": [\r\n                    {\r\n                        \"reference\": {\r\n                            \"reference\": \"ClinicalImpression/ExampleConclusionMREC\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"patient\": {\r\n                    \"reference\": \"Patient/ExamplePatientWithIdentificationNumber\"\r\n                },\r\n                \"agent\": [\r\n                    {\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/AgentTypeProvenance\",\r\n                                    \"code\": \"organization\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"who\": {\r\n                            \"extension\": [\r\n                                {\r\n                                    \"url\": \"https://fhir.by/StructureDefinition/ExtStringValue\",\r\n                                    \"valueString\": \"{{codeMREC}}\"\r\n                                }\r\n                            ],\r\n                            \"reference\": \"Organization/{{OrganizationMREC}}\",\r\n                            \"display\": \"{{OrganizationName}}\"\r\n                        }\r\n                    },\r\n                    {\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/AgentTypeProvenance\",\r\n                                    \"code\": \"practitioner\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"who\": {\r\n                            \"reference\": \"Practitioner/{{PractitionerMREC}}\",\r\n                            \"display\": \"{{PractitionerName}}\"\r\n                        }\r\n                    },\r\n                    {\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/AgentTypeProvenance\",\r\n                                    \"code\": \"practitionerRole\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"who\": {\r\n                            \"reference\": \"PractitionerRole/{{PractitionerRoleMREC}}\",\r\n                            \"display\": \"{{PractitionerRoleName}}\"\r\n                        }\r\n                    }\r\n                ]\r\n            }\r\n        }\r\n    ]\r\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Bundle/$import",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Bundle",
                    "$import"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Метод получения статуса операции импорта пакета медицинской информации",
              "request": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Bundle/{{bundleId}}/$status",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Bundle",
                    "{{bundleId}}",
                    "$status"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Метод проверки наличия у пациента актуальных заключений МРЭК",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "var jsonData = pm.response.json();\r",
                      "let patientId = jsonData.entry.find(obj => obj.resource.resourceType === \"ClinicalImpression\").resource.id;\r",
                      "\r",
                      "pm.collectionVariables.set(\"clinicalImpressionId\", patientId);\r",
                      "console.log(patientId)\r",
                      ""
                    ],
                    "type": "text/javascript",
                    "packages": {}
                  }
                }
              ],
              "request": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient/{{patientId}}/ClinicalImpression?_profile=https://fhir.by/StructureDefinition/ConclusionMREC&status=completed",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient",
                    "{{patientId}}",
                    "ClinicalImpression"
                  ],
                  "query": [
                    {
                      "key": "_profile",
                      "value": "https://fhir.by/StructureDefinition/ConclusionMREC"
                    },
                    {
                      "key": "status",
                      "value": "completed"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Метод проверка наличия у пациента актуальных индивидуальных программ реабилитации",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "var jsonData = pm.response.json();\r",
                      "let patientId = jsonData.entry.find(obj => obj.resource.resourceType === \"CarePlan\").resource.id;\r",
                      "\r",
                      "pm.collectionVariables.set(\"carePlanId\", patientId);\r",
                      "console.log(patientId)\r",
                      ""
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "protocolProfileBehavior": {
                "disableBodyPruning": true
              },
              "request": {
                "method": "GET",
                "header": [],
                "body": {
                  "mode": "raw",
                  "raw": "",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient/{{patientId}}/CarePlan?_profile=https://fhir.by/StructureDefinition/IPR&status=active",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient",
                    "{{patientId}}",
                    "CarePlan"
                  ],
                  "query": [
                    {
                      "key": "_profile",
                      "value": "https://fhir.by/StructureDefinition/IPR"
                    },
                    {
                      "key": "status",
                      "value": "active"
                    }
                  ]
                }
              },
              "response": []
            }
          ],
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "packages": {},
                "requests": {},
                "exec": [
                  ""
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "packages": {},
                "requests": {},
                "exec": [
                  ""
                ]
              }
            }
          ]
        },
        {
          "name": "Кейс 5. Пациент без инвалидности направлен на медико-социальную экспертизу для освидетельствования(Досрочное снятие группы инвалидности.)",
          "item": [
            {
              "name": "поиск пациента по идентификационному номеру",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "var jsonData = pm.response.json();\r\nlet patientId = jsonData.entry.find(obj => obj.resource.resourceType === \"Patient\").resource.id;\r\n\r\npm.collectionVariables.set(\"patientId\", patientId);\r\nconsole.log(patientId)\r\n"
                    ]
                  }
                }
              ],
              "protocolProfileBehavior": {
                "disableBodyPruning": true
              },
              "request": {
                "method": "GET",
                "header": [],
                "body": {
                  "mode": "raw",
                  "raw": "",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient?identifier=7111071A009PB3",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient"
                  ],
                  "query": [
                    {
                      "key": "identifier",
                      "value": "7111071A009PB3"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Создание пациента в ЦИСЗ",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Валидный бандл должен отработать со статусом 202\", function () {\r\n    pm.response.to.have.status(202);\r\n});\r\n\r\nvar jsonData = pm.response.json();\r\nlet bundleId = jsonData.parameter.find(obj => obj.name === \"ResourceId\").valueString;\r\nlet statusReference = jsonData.parameter.find(obj => obj.name === \"OperationStatusReference\");\r\n\r\nconsole.log(statusReference.valueReference.reference);\r\n\r\npm.collectionVariables.set(\"bundleId\", bundleId);\r\npm.collectionVariables.set(\"StatusUrl\", statusReference.valueReference.reference);\r\n"
                    ]
                  }
                }
              ],
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Fhir-By-Version",
                    "value": "active"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\r\n                \"resourceType\": \"Patient\",\r\n                \"id\": \"PatientBundleForTest\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/PatientWithIdentificationNumber\"\r\n                    ]\r\n                },\r\n                \"identifier\": [\r\n                    {\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/PersonalDocumentType\",\r\n                                    \"code\": \"INP\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"value\": \"7111071A009PB3\"\r\n                    }\r\n                    \r\n                ],\r\n                \"extension\": [\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/PatientJobProfession\",\r\n                                \"valueString\": \"Токарь\"\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/PatientJobProfessionCode\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/SpecialtyProfPerson\",\r\n                                            \"code\": \"7223-093\",\r\n                                            \"display\": \"Токарь-расточник\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/PatientJobPlace\",\r\n                                \"valueString\": \"Минский подшипниковый завод\"\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/TermOFWork\",\r\n                                \"valuePeriod\": {\r\n                                    \"start\": \"2024-01-01\"\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/MainJobPlace\",\r\n                                \"valueBoolean\": true\r\n                            }\r\n                        ],\r\n                        \"url\": \"https://fhir.by/StructureDefinition/PatientJob\"\r\n                    }\r\n                    \r\n                ],\r\n                \"active\": true,\r\n                \"name\": [\r\n                    {\r\n                        \"family\": \"Иванов\",\r\n                        \"given\": [\r\n                            \"Петр\",\r\n                            \"Сидорович\"\r\n                        ]\r\n                    }\r\n                ],\r\n                \"telecom\": [\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/PatientTelecomPurpose\",\r\n                                \"extension\": [\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/PatientNotificationType\",\r\n                                        \"valueCodeableConcept\": {\r\n                                            \"coding\": [\r\n                                                {\r\n                                                    \"system\": \"https://fhir.by/ValueSet/PatientNotificationType\",\r\n                                                    \"code\": \"SMS\"\r\n                                                }\r\n                                            ]\r\n                                        }\r\n                                    },\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/PatientConsentForNotification\",\r\n                                        \"valueBoolean\": true\r\n                                    }\r\n                                ]\r\n                            }\r\n                        ],\r\n                        \"system\": \"phone\",\r\n                        \"value\": \"+375291112233\"\r\n                    }\r\n                ],\r\n                \"gender\": \"male\",\r\n                \"birthDate\": \"1990-12-31\",\r\n                \"deceasedBoolean\": false,\r\n                \"address\": [\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                            \"version\": \"1.51\",\r\n                                            \"code\": \"BY\",\r\n                                            \"display\": \"Беларусь\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                            \"version\": \"1.3\",\r\n                                            \"code\": \"2938771891184418\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                                \"valueString\": \"кв. 101\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"home\",\r\n                        \"text\": \"Витебская область, г. Витебск, Улица 19-я Городокская, д. 5\"\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                            \"version\": \"1.51\",\r\n                                            \"code\": \"BY\",\r\n                                            \"display\": \"Беларусь\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                            \"version\": \"1.3\",\r\n                                            \"code\": \"12463236041049757\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                                \"valueString\": \"кв. 1201\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"temp\",\r\n                        \"text\": \"Брестская область, г. Пинск, Улица Центральная, д. 9\"\r\n                    }\r\n                ]\r\n            }",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "поиск пациента по идентификационному номеру",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "var jsonData = pm.response.json();\r\nlet patientId = jsonData.entry.find(obj => obj.resource.resourceType === \"Patient\").resource.id;\r\n\r\npm.collectionVariables.set(\"patientId\", patientId);\r\nconsole.log(patientId)\r\n"
                    ]
                  }
                }
              ],
              "protocolProfileBehavior": {
                "disableBodyPruning": true
              },
              "request": {
                "method": "GET",
                "header": [],
                "body": {
                  "mode": "raw",
                  "raw": "",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient?identifier=7111071A009PB3",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient"
                  ],
                  "query": [
                    {
                      "key": "identifier",
                      "value": "7111071A009PB3"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "импорт пакета медицинских данных",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Валидный бандл должен отработать со статусом 202\", function () {\r\n    pm.response.to.have.status(202);\r\n});\r\n\r\nvar jsonData = pm.response.json();\r\nlet bundleId = jsonData.parameter.find(obj => obj.name === \"ResourceId\").valueString;\r\nlet statusReference = jsonData.parameter.find(obj => obj.name === \"OperationStatusReference\");\r\n\r\nconsole.log(statusReference.valueReference.reference);\r\n\r\npm.collectionVariables.set(\"bundleId\", bundleId);\r\npm.collectionVariables.set(\"StatusUrl\", statusReference.valueReference.reference);\r\n"
                    ]
                  }
                }
              ],
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Fhir-By-Version",
                    "value": "active"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\r\n    \"resourceType\": \"Bundle\",\r\n    \"id\": \"BundleForTest\",\r\n    \"meta\": {\r\n        \"profile\": [\r\n            \"https://fhir.by/AbstractArea/StructureDefinition/Bundle/MedicationDocument\"\r\n        ]\r\n    },\r\n    \"identifier\": {\r\n        \"system\": \"https://fhir.by/ValueSet/urn:ietf:rfc:3986\",\r\n        \"value\": \"urn:uuid:0c3151bd-1cbf-4d64-b04d-{{$guid}}\"\r\n    },\r\n    \"type\": \"document\",\r\n    \"timestamp\": \"2024-04-07T11:30:00Z\",\r\n    \"entry\": [\r\n        {\r\n            \"fullUrl\": \"Composition/CompositionBundleForTest\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Composition\",\r\n                \"id\": \"{{$guid}}\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/CompDocument\"\r\n                    ]\r\n                },\r\n                \"status\": \"registered\",\r\n                \"type\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/CompositionType\",\r\n                            \"code\": \"general\",\r\n                            \"display\": \"Общая медицинская информация\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"subject\": [\r\n                    {\r\n                        \"reference\": \"Patient/PatientBundleForTest\"\r\n                    }\r\n                ],\r\n                \"date\": \"2024-04-07T11:12:21Z\",\r\n                \"author\": [\r\n                    {\r\n                        \"reference\": \"Practitioner/{{PractitionerMREC}}\"\r\n                    }\r\n                ],\r\n                \"title\": \"CompDocument для наполненного Bundle\",\r\n                \"custodian\": {\r\n                    \"reference\": \"Organization/{{OrganizationMREC}}\"\r\n                }\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Patient/PatientBundleForTest\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Patient\",\r\n                \"id\": \"ExamplePatientWithIdentificationNumber\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/PatientED\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/DocumentKind\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/DigitalDocumentKind\",\r\n                                    \"code\": \"00\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    }\r\n                ],\r\n                \"identifier\": [\r\n                    {\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/PersonalDocumentType\",\r\n                                    \"code\": \"INP\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"value\": \"7111071A009PB3\"\r\n                    }\r\n                ],\r\n                \"active\": true,\r\n                \"name\": [\r\n                    {\r\n                        \"family\": \"Иванов\",\r\n                        \"given\": [\r\n                            \"Петр\",\r\n                            \"Сидорович\"\r\n                        ]\r\n                    }\r\n                ],\r\n                \"birthDate\": \"1990-12-31\",\r\n                \"gender\": \"male\",\r\n                \"telecom\": [\r\n                    {\r\n                        \"system\": \"phone\",\r\n                        \"value\": \"+375291112233\"\r\n                    }\r\n                ],\r\n                \"address\": [\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                            \"version\": \"1.51\",\r\n                                            \"code\": \"BY\",\r\n                                            \"display\": \"Беларусь\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                            \"version\": \"1.3\",\r\n                                            \"code\": \"2938771891184418\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                                \"valueString\": \"кв. 101\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"home\",\r\n                        \"text\": \"Витебская область, г. Витебск, Улица 19-я Городокская, д. 5\"\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                            \"version\": \"1.51\",\r\n                                            \"code\": \"BY\",\r\n                                            \"display\": \"Беларусь\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                            \"version\": \"1.3\",\r\n                                            \"code\": \"12463236041049757\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                                \"valueString\": \"кв. 1201\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"temp\",\r\n                        \"text\": \"Брестская область, г. Пинск, Улица Центральная, д. 9\"\r\n                    }\r\n                ],\r\n                \"link\": [\r\n                    {\r\n                        \"other\": {\r\n                            \"reference\": \"Patient/{{patientId}}\"\r\n                        },\r\n                        \"type\": \"refer\"\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Encounter/EncounterBundleForTest\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Encounter\",\r\n                \"id\": \"ExampleEncounterForMREC\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/EncounterGeneral\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/EncouterMRECConcent\",\r\n                        \"valueBoolean\": true\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/DisabilityFirstTime\",\r\n                        \"valueBoolean\": true\r\n                    }\r\n                ],\r\n                \"identifier\": [\r\n                    {\r\n                        \"value\": \"1235\",\r\n                        \"assigner\": {\r\n                            \"reference\": \"Organization/{{OrganizationMREC}}\",\r\n                            \"display\": \"Учреждение здравоохранения \\\"Витебская областная медико-реабилитационная экспертная комиссия\\\"\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"status\": \"completed\",\r\n                \"class\": [\r\n                    {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/VSTermsOfService\",\r\n                                \"code\": \"1\"\r\n                            }\r\n                        ]\r\n                    }\r\n                ],\r\n                \"priority\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/HealthCareForms\",\r\n                            \"code\": \"planned\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"type\": [\r\n                    {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/TypeOfHealthCare\",\r\n                                \"code\": \"special\"\r\n                            }\r\n                        ]\r\n                    }\r\n                ],\r\n                \"subject\": {\r\n                    \"reference\": \"Patient/{{patientId}}\",\r\n                    \"display\": \"Иванова Лариса Ивановна\"\r\n                },\r\n                \"serviceProvider\": {\r\n                    \"reference\": \"Organization/{{OrganizationMREC}}\"\r\n                },\r\n                \"actualPeriod\": {\r\n                    \"start\": \"2026-09-15T10:10:21Z\",\r\n                    \"end\": \"2026-09-15T12:00:21Z\"\r\n                },\r\n                \"participant\": [\r\n                    {\r\n                        \"actor\": {\r\n                            \"reference\": \"PractitionerRole/{{PractitionerRoleMREC}}\",\r\n                            \"display\": \"Иванов Владислав Эдуардович\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"diagnosis\": [\r\n                    {\r\n                        \"condition\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"Condition/ExampleDiagnosisMREC\"\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"use\": [\r\n                            {\r\n                                \"coding\": [\r\n                                    {\r\n                                        \"system\": \"https://fhir.by/ValueSet/TypeOfDiagnosis\",\r\n                                        \"code\": \"mainDiagnosis\"\r\n                                    }\r\n                                ]\r\n                            }\r\n                        ]\r\n                    }\r\n                   \r\n                ],\r\n                \"location\": [\r\n                    {\r\n                        \"location\": {\r\n                            \"reference\": \"Location/{{LocationMREC}}\"\r\n                        }\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Condition/ExampleDiagnosisMREC\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Condition\",\r\n                \"id\": \"ExampleDiagnosisMREC\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/FinalDiagnosis\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/KindOfDiagnosis\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/KindOfDiagnosisCode\",\r\n                                    \"code\": \"Сlinical-functional\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/AssertedDate\",\r\n                        \"valueDateTime\": \"2026-09-01\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/FirstTimeRevealed\",\r\n                        \"valueBoolean\": true\r\n                    }\r\n                ],\r\n                \"clinicalStatus\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"http://terminology.hl7.org/CodeSystem/condition-clinical\",\r\n                            \"code\": \"active\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"code\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/InternClassificDiseases10\",\r\n                            \"code\": \"M17.3\",\r\n                            \"display\": \"Другие посттравматические гонартрозы\"\r\n                           \r\n                        }\r\n                    ]\r\n                },\r\n                \"subject\": {\r\n                    \"reference\": \"Patient/{{patientId}}\"\r\n                },\r\n                \"onsetDateTime\": \"2026-09-01\",\r\n                \"recordedDate\": \"2026-09-01\",\r\n                \"participant\": [\r\n                    {\r\n                        \"actor\": {\r\n                            \"reference\": \"PractitionerRole/{{PractitionerRoleMREC}}\",\r\n                            \"display\": \"Иванов Владислав Эдуардович\"\r\n                        }\r\n                    }\r\n                ]\r\n            }\r\n        }\r\n        \r\n    ]\r\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Bundle/$import",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Bundle",
                    "$import"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "получение статуса импорта пакета медицинских данных",
              "request": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Bundle/{{bundleId}}/$status",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Bundle",
                    "{{bundleId}}",
                    "$status"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Поиск обращения пациента к врачу",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "var jsonData = pm.response.json();\r\n\r\n// Фильтруем только Encounter ресурсы, исключая OperationOutcome\r\nlet encounterEntries = jsonData.entry.filter(entry => \r\n    entry.resource && entry.resource.resourceType === \"Encounter\"\r\n);\r\n\r\nif (encounterEntries.length > 0) {\r\n    // Сортируем по дате lastUpdated (от новых к старым) и берем самый свежий\r\n    encounterEntries.sort((a, b) => \r\n        new Date(b.resource.meta.lastUpdated) - new Date(a.resource.meta.lastUpdated)\r\n    );\r\n    \r\n    let latestEncounter = encounterEntries[0];\r\n    let encounterId = latestEncounter.resource.id;\r\n    pm.collectionVariables.set(\"encounterId\", encounterId);\r\n    console.log(\"Latest encounterId:\", encounterId);\r\n    console.log(\"Last updated:\", latestEncounter.resource.meta.lastUpdated);\r\n} else {\r\n    console.log(\"No Encounter resources found in response\");\r\n}"
                    ]
                  }
                }
              ],
              "protocolProfileBehavior": {
                "disableBodyPruning": true
              },
              "request": {
                "method": "GET",
                "header": [],
                "body": {
                  "mode": "raw",
                  "raw": "",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient/{{patientId}}/Encounter?_profile=https://fhir.by/StructureDefinition/EncounterGeneral&patient={{patientId}}&_sort=-_lastUpdated",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient",
                    "{{patientId}}",
                    "Encounter"
                  ],
                  "query": [
                    {
                      "key": "_profile",
                      "value": "https://fhir.by/StructureDefinition/EncounterGeneral"
                    },
                    {
                      "key": "patient",
                      "value": "{{patientId}}"
                    },
                    {
                      "key": "_sort",
                      "value": "-_lastUpdated"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Поиск диагноза пациента к врачу",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "var jsonData = pm.response.json();\r\nlet conditionId = jsonData.entry.find(obj => obj.resource.resourceType === \"Condition\").resource.id;\r\n\r\npm.collectionVariables.set(\"conditionId\", conditionId);\r\nconsole.log(conditionId)\r\n"
                    ]
                  }
                }
              ],
              "protocolProfileBehavior": {
                "disableBodyPruning": true
              },
              "request": {
                "method": "GET",
                "header": [],
                "body": {
                  "mode": "raw",
                  "raw": "",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient/{{patientId}}/Condition?_profile=https://fhir.by/StructureDefinition/FinalDiagnosis&_sort=-_lastUpdated",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient",
                    "{{patientId}}",
                    "Condition"
                  ],
                  "query": [
                    {
                      "key": "_profile",
                      "value": "https://fhir.by/StructureDefinition/FinalDiagnosis"
                    },
                    {
                      "key": "_sort",
                      "value": "-_lastUpdated"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Метод проверки отсутствия у пациента актуальных заключений МРЭК",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      ""
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "request": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient/{{patientId}}/ClinicalImpression?_profile=https://fhir.by/StructureDefinition/ConclusionMREC&status=completed",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient",
                    "{{patientId}}",
                    "ClinicalImpression"
                  ],
                  "query": [
                    {
                      "key": "_profile",
                      "value": "https://fhir.by/StructureDefinition/ConclusionMREC"
                    },
                    {
                      "key": "status",
                      "value": "completed"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Метод проверка отсутствия у пациента актуальных индивидуальных программ реабилитации",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      ""
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "protocolProfileBehavior": {
                "disableBodyPruning": true
              },
              "request": {
                "method": "GET",
                "header": [],
                "body": {
                  "mode": "raw",
                  "raw": "",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient/{{patientId}}/CarePlan?_profile=https://fhir.by/StructureDefinition/IPR&status=active",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient",
                    "{{patientId}}",
                    "CarePlan"
                  ],
                  "query": [
                    {
                      "key": "_profile",
                      "value": "https://fhir.by/StructureDefinition/IPR"
                    },
                    {
                      "key": "status",
                      "value": "active"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Метод получения идентификатора электронного документа",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "var jsonData = pm.response.json();\r\nlet identifier = jsonData.parameter.find(obj => obj.name === \"identifier\").valueString;\r\npm.collectionVariables.set(\"identifier\", identifier);\r\nconsole.log(identifier)"
                    ]
                  }
                }
              ],
              "request": {
                "method": "POST",
                "header": [],
                "body": {
                  "mode": "raw",
                  "raw": "{\r\n    \"resourceType\": \"Parameters\",\r\n    \"parameter\": [\r\n        {\r\n            \"name\": \"document-code\",\r\n            \"valueCoding\": {\r\n                \"system\": \"https://fhir.by/ValueSet/DigitalDocumentKind\",\r\n                \"code\": \"04\"\r\n            }\r\n        }\r\n    ]\r\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/$get-document-id",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "$get-document-id"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Метод импорта пакета медицинской информации (заключение МРЭК)",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Валидный бандл должен отработать со статусом 202\", function () {\r\n    pm.response.to.have.status(202);\r\n});\r\n\r\nvar jsonData = pm.response.json();\r\nlet bundleId = jsonData.parameter.find(obj => obj.name === \"ResourceId\").valueString;\r\nlet statusReference = jsonData.parameter.find(obj => obj.name === \"OperationStatusReference\");\r\n\r\nconsole.log(statusReference.valueReference.reference);\r\n\r\npm.collectionVariables.set(\"bundleId\", bundleId);\r\npm.collectionVariables.set(\"StatusUrl\", statusReference.valueReference.reference);\r\n"
                    ]
                  }
                }
              ],
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Fhir-By-Version",
                    "value": "active"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\r\n    \"resourceType\": \"Bundle\",\r\n    \"id\": \"BundleConclusionMRECDisability190110\",\r\n    \"meta\": {\r\n        \"profile\": [\r\n            \"https://fhir.by/AbstractArea/StructureDefinition/Bundle/BundleMREC\"\r\n        ]\r\n    },\r\n    \"identifier\": {\r\n        \"system\": \"https://minzdrav.gov.by\",\r\n        \"value\": \"{{identifier}}\"\r\n    },\r\n    \"type\": \"document\",\r\n    \"timestamp\": \"2024-09-01T11:12:21Z\",\r\n    \"entry\": [\r\n        {\r\n            \"fullUrl\": \"Composition/ExampleCompositionMRECDisability\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Composition\",\r\n                \"id\": \"ExampleCompositionMRECDisability\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/DocumentMREC\"\r\n                    ]\r\n                },\r\n                \"status\": \"final\",\r\n                \"type\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/CompositionType\",\r\n                            \"code\": \"conclusion-mrec\",\r\n                            \"display\": \"Заключение МРЭК\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"subject\": [\r\n                    {\r\n                        \"reference\": \"Patient/ExamplePatientWithIdentificationNumber\"\r\n                    }\r\n                ],\r\n                \"date\": \"2024-09-01T11:12:21Z\",\r\n                \"author\": [\r\n                    {\r\n                        \"reference\": \"Practitioner/{{PractitionerMREC}}\"\r\n                    }\r\n                ],\r\n                \"title\": \"Уточненный состав необходимых данных о лице, предоставляемых медико-реабилитационными экспертными комиссиями\",\r\n                \"custodian\": {\r\n                    \"reference\": \"Organization/{{OrganizationMREC}}\"\r\n                },\r\n                \"event\": [\r\n                    {\r\n                        \"detail\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"ClinicalImpression/ExampleConclusionMREC\"\r\n                                }\r\n                            }\r\n                        ]\r\n                    },\r\n                    {\r\n                        \"detail\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"CarePlan/ExampleIPR\"\r\n                                }\r\n                            }\r\n                        ]\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Patient/ExamplePatientWithIdentificationNumber\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Patient\",\r\n                \"id\": \"ExamplePatientWithIdentificationNumber\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/PatientED\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/DocumentKind\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/DigitalDocumentKind\",\r\n                                    \"code\": \"04\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    }\r\n                ],\r\n                \"identifier\": [\r\n                    {\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/PersonalDocumentType\",\r\n                                    \"code\": \"INP\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"value\": \"7111071A009PB3\"\r\n                    }\r\n                ],\r\n                \"active\": true,\r\n                \"name\": [\r\n                    {\r\n                        \"family\": \"Иванов\",\r\n                        \"given\": [\r\n                            \"Петр\",\r\n                            \"Сидорович\"\r\n                        ]\r\n                    }\r\n                ],\r\n                \"birthDate\": \"1990-12-31\",\r\n                \"telecom\": [\r\n                    {\r\n                        \"system\": \"phone\",\r\n                        \"value\": \"+375291112233\"\r\n                    }\r\n                ],\r\n                \"address\": [\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                            \"version\": \"1.51\",\r\n                                            \"code\": \"BY\",\r\n                                            \"display\": \"Беларусь\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                            \"version\": \"1.3\",\r\n                                            \"code\": \"2938771891184418\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                                \"valueString\": \"кв. 101\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"home\",\r\n                        \"text\": \"Витебская область, г. Витебск, Улица 19-я Городокская, д. 5\"\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                            \"version\": \"1.51\",\r\n                                            \"code\": \"BY\",\r\n                                            \"display\": \"Беларусь\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                            \"version\": \"1.3\",\r\n                                            \"code\": \"12463236041049757\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                                \"valueString\": \"кв. 1201\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"temp\",\r\n                        \"text\": \"Брестская область, г. Пинск, Улица Центральная, д. 9\"\r\n                    }\r\n                ],\r\n                \"link\": [\r\n                    {\r\n                        \"other\": {\r\n                            \"reference\": \"Patient/{{patientId}}\"\r\n                        },\r\n                        \"type\": \"refer\"\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"ClinicalImpression/ExampleConclusionMREC\",\r\n            \"resource\": {\r\n                \"resourceType\": \"ClinicalImpression\",\r\n                \"id\": \"ExampleConclusionMREC\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/ConclusionMREC\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CodesReasonForMREC\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/ReasonForMREC\",\r\n                                            \"code\": \"definition-disability\"\r\n                                            \r\n                                        }\r\n                                    ]\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"url\": \"https://fhir.by/StructureDefinition/ReasonForMREC\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/ExtSurveyTypeMREC\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/SurveyTypeMREC\",\r\n                                    \"code\": \"1\",\r\n                                    \"display\": \"первичное очное\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/LossOfProfessionalAbilityPercentage\",\r\n                                \"valueQuantity\": {\r\n                                    \"value\": 40,\r\n                                    \"unit\": \"%\",\r\n                                    \"system\": \"https://fhir.by/ValueSet/UnitsOfMeasureBy\"\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/LossOfProfessionalAbilityCase\",\r\n                                \"valueString\": \"Страховой случай, его дата, документ, послуживший основанием для установления степени утраты профессиональной трудоспособности\"\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/LossOfProfessionalAbilityTerm\",\r\n                                \"valuePeriod\": {\r\n                                    \"start\": \"2026-09-20\",\r\n                                    \"end\": \"2026-09-20\"\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"url\": \"https://fhir.by/StructureDefinition/LossOfProfessionalAbility\"\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ContraindicatedFactors\",\r\n                                \"valueString\": \"Противопоказанные факторы производственной среды, тяжесть и напряженность трудового процесса, виды работ\"\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/IndicatedFactors\",\r\n                                \"valueString\": \"Показанные условия труда и режим рабочего времени с уменьшением продолжительности рабочего времени (рабочего дня или рабочей недели) на 25%\"\r\n                            }\r\n                        ],\r\n                        \"url\": \"https://fhir.by/StructureDefinition/RequirementsForWorking\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/DisabilityCertificate\",\r\n                        \"valueIdentifier\": {\r\n                            \"value\": \"15№ 00013839\",\r\n                            \"period\": {\r\n                                \"start\": \"2026-09-20\",\r\n                                \"end\": \"2027-09-20\"\r\n                            },\r\n                            \"assigner\": {\r\n                                \"reference\": \"Organization/{{OrganizationMREC}}\"\r\n                            }\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/DisabilityGroup\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/DisabilityGroup\",\r\n                                    \"code\": \"3_group\",\r\n                                    \"display\": \"III группа\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/DisabilityReason\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/DisabilityReason\",\r\n                                    \"code\": \"general\",\r\n                                    \"display\": \"общее заболевание\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/AdditionalTypesOfHelp\",\r\n                        \"valueString\": \"не нуждается в постоянной помощи\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/AdditionalTypesOfCare\",\r\n                        \"valueString\": \"не нуждается в постоянном уходе\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/AdditionalForConclusionMREC\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/AdditionalForConclusionMREC\",\r\n                                    \"code\": \"absens\",\r\n                                    \"display\": \"отсутствует\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/ProgramRehabilitionMREC\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/ProgramRehabilitionMREC\",\r\n                                    \"code\": \"ipra\",\r\n                                    \"display\": \"индивидуальная программа реабилитации, абилитации инвалида\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    }\r\n                ],\r\n                \"encounter\": {\r\n                    \"reference\": \"Encounter/{{encounterId}}\"\r\n                },\r\n                \"identifier\": [\r\n                    {\r\n                        \"value\": \"{{identifier}}\",\r\n                        \"period\": {\r\n                            \"start\": \"2026-09-20\",\r\n                            \"end\": \"2027-09-20\"\r\n                        },\r\n                        \"assigner\": {\r\n                            \"extension\": [\r\n                                {\r\n                                    \"url\": \"https://fhir.by/StructureDefinition/LocationReference\",\r\n                                    \"valueReference\": {\r\n                                        \"reference\": \"Location/{{LocationMREC}}\"\r\n                                    }\r\n                                }\r\n                            ],\r\n                            \"reference\": \"Organization/{{OrganizationMREC}}\",\r\n                            \"display\": \"{{OrganizationName}}\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"status\": \"completed\",\r\n                \"description\": \"Заключение МРЭК №{{identifier}}, Иванова Лариса Ивановна, 31.12.1990\",\r\n                \"subject\": {\r\n                    \"reference\": \"Patient/ExamplePatientWithIdentificationNumber\"\r\n                },\r\n                \"effectiveDateTime\": \"2026-09-25\",\r\n                \r\n                \"date\": \"2026-09-20\",\r\n                \"performer\": {\r\n                    \"reference\": \"PractitionerRole/{{PractitionerRoleMREC}}\"\r\n                }\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"CarePlan/ExampleIPR\",\r\n            \"resource\": {\r\n                \"resourceType\": \"CarePlan\",\r\n                \"id\": \"ExampleIPR\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/IPR\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/AdditionalForConclusionMREC\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/AdditionalForConclusionMREC\",\r\n                                    \"code\": \"absens\",\r\n                                    \"display\": \"отсутствует\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ContraindicatedFactors\",\r\n                                \"valueString\": \"Противопоказанные факторы производственной среды, тяжесть и напряженность трудового процесса, виды работ\"\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/IndicatedFactors\",\r\n                                \"valueString\": \"Показанные условия труда и режим рабочего времени с уменьшением продолжительности рабочего времени (рабочего дня или рабочей недели) на 25%\"\r\n                            }\r\n                        ],\r\n                        \"url\": \"https://fhir.by/StructureDefinition/RequirementsForWorking\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/ReferredInitially\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/RehabProgramm\",\r\n                                    \"code\": \"first\",\r\n                                    \"display\": \"впервые\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/ReferenceToConclusionMREC\",\r\n                        \"valueReference\": {\r\n                            \"reference\": \"ClinicalImpression/ExampleConclusionMREC\"\r\n                        }\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/DisorderCode\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/DisordersFunctionAndSystem\",\r\n                                            \"code\": \"statodynamicdisf\",\r\n                                            \"display\": \"нарушения статодинамической функции (движения головы, туловища, конечностей, опоры и ходьбы, статики, координации движений, вестибулярной функции)\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/DisorderGrade\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/DegreesOfManifestationOfDisfunctions\",\r\n                                            \"code\": \"medium\",\r\n                                            \"display\": \"умеренные\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"url\": \"https://fhir.by/StructureDefinition/ExtDisordersFunctionAndSystem\"\r\n                    }\r\n                    \r\n                ],\r\n                \"identifier\": [\r\n                    {\r\n                        \"value\": \"{{identifier}}\",\r\n                        \"assigner\": {\r\n                            \"extension\": [\r\n                                {\r\n                                    \"url\": \"https://fhir.by/StructureDefinition/LocationReference\",\r\n                                    \"valueReference\": {\r\n                                        \"reference\": \"Location/{{LocationMREC}}\"\r\n                                    }\r\n                                }\r\n                            ],\r\n                            \"reference\": \"Organization/{{OrganizationMREC}}\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"period\": {\r\n                    \"start\": \"2024-09-20\",\r\n                    \"end\": \"2025-09-20\"\r\n                },\r\n                \"basedOn\": [\r\n                    {\r\n                        \"identifier\": {\r\n                            \"value\": \"{{identifier}}\",\r\n                            \"period\": {\r\n                                \"start\": \"2024-09-20\"\r\n                            }\r\n                        }\r\n                    }\r\n                ],\r\n                \"status\": \"active\",\r\n                \"intent\": \"plan\",\r\n                \"title\": \"Программа реабилитации инвалида\",\r\n                \"subject\": {\r\n                    \"reference\": \"Patient/ExamplePatientWithIdentificationNumber\"\r\n                },\r\n                \"created\": \"2024-09-20\",\r\n                \"custodian\": {\r\n                    \"reference\": \"Organization/{{OrganizationMREC}}\"\r\n                },\r\n                \"contributor\": [\r\n                    {\r\n                        \"reference\": \"PractitionerRole/{{PractitionerRoleMREC}}\",\r\n                        \"display\": \"Председатель МРЭК\"\r\n                    }\r\n                ],\r\n                \"addresses\": [\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ActivitiesLoss\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/FunctionalClass\",\r\n                                            \"code\": \"2\",\r\n                                            \"display\": \"Функциональный класс II\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"concept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/RestrictCategoriesActivity\",\r\n                                    \"code\": \"abletoselfcare\",\r\n                                    \"display\": \"Способность к самообслуживанию.\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ActivitiesLoss\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/FunctionalClass\",\r\n                                            \"code\": \"1\",\r\n                                            \"display\": \"Функциональный класс I.\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"concept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/RestrictCategoriesActivity\",\r\n                                    \"code\": \"abletoorientate\",\r\n                                    \"display\": \"Способность к ориентации.\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    }\r\n                ],\r\n                \"activity\": [\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"extension\": [\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/MedicalRehabilitationEventCode\",\r\n                                        \"valueCodeableConcept\": {\r\n                                            \"coding\": [\r\n                                                {\r\n                                                    \"system\": \"https://fhir.by/ValueSet/RehubActivities\",\r\n                                                    \"code\": \"complex\",\r\n                                                    \"display\": \"Физиотерапия\"\r\n                                                }\r\n                                            ]\r\n                                        }\r\n                                    },\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/RehabilitationEventNeediness\",\r\n                                        \"valueCodeableConcept\": {\r\n                                            \"coding\": [\r\n                                                {\r\n                                                    \"system\": \"https://fhir.by/ValueSet/Neediness\",\r\n                                                    \"code\": \"need\",\r\n                                                    \"display\": \"нуждается\"\r\n                                                }\r\n                                            ]\r\n                                        }\r\n                                    },\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/RehabilitationEventString\",\r\n                                        \"valueString\": \"Магнитотерапия на всё\"\r\n                                    },\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/RehabilitationEventPeriod\",\r\n                                        \"valuePeriod\": {\r\n                                            \"start\": \"2024-01-05\"\r\n                                        }\r\n                                    }\r\n                                ],\r\n                                \"url\": \"https://fhir.by/StructureDefinition/MedicalRehabilitationEvent\"\r\n                            }\r\n                        ],\r\n                        \"progress\": [\r\n                            {\r\n                                \"text\": \"Поликлиника №15 в течение 6 месяцев  \"\r\n                            }\r\n                        ]\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"extension\": [\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/SocialRehabilitationEventCode\",\r\n                                        \"valueCodeableConcept\": {\r\n                                            \"coding\": [\r\n                                                {\r\n                                                    \"system\": \"https://fhir.by/ValueSet/SocRehab\",\r\n                                                    \"code\": \"psychohelp\",\r\n                                                    \"display\": \"Психологическая помощь\"\r\n                                                }\r\n                                            ]\r\n                                        }\r\n                                    },\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/RehabilitationEventNeediness\",\r\n                                        \"valueCodeableConcept\": {\r\n                                            \"coding\": [\r\n                                                {\r\n                                                    \"system\": \"https://fhir.by/ValueSet/Neediness\",\r\n                                                    \"code\": \"need\",\r\n                                                    \"display\": \"нуждается\"\r\n                                                }\r\n                                            ]\r\n                                        }\r\n                                    },\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/RehabilitationEventString\",\r\n                                        \"valueString\": \"Другие методы реабилитации или ТССР\"\r\n                                    },\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/RehabilitationEventPeriod\",\r\n                                        \"valuePeriod\": {\r\n                                            \"start\": \"2024-09-20\"\r\n                                        }\r\n                                    }\r\n                                ],\r\n                                \"url\": \"https://fhir.by/StructureDefinition/SocialRehabilitationEvent\"\r\n                            }\r\n                        ],\r\n                        \"progress\": [\r\n                            {\r\n                                \"text\": \"Поликлиника №15 в течение 6 месяцев\"\r\n                            }\r\n                        ]\r\n                    }\r\n                ]\r\n                \r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Provenance/ExampleProvenanceDocumentInfoMRECDisability\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Provenance\",\r\n                \"id\": \"ExampleProvenanceDocumentInfoMRECDisability\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/ProvenanceDocumentInfoMREC\"\r\n                    ]\r\n                },\r\n                \"target\": [\r\n                    {\r\n                        \"reference\": \"Patient/ExamplePatientWithIdentificationNumber\"\r\n                    }\r\n                ],\r\n                \"recorded\": \"2024-09-20T11:12:21Z\",\r\n                \"location\": {\r\n                    \"extension\": [\r\n                        {\r\n                            \"url\": \"https://fhir.by/StructureDefinition/ExtStringValue\",\r\n                            \"valueString\": \"{{codeMrecLocation}}\"\r\n                        }\r\n                    ],\r\n                    \"reference\": \"Location/{{LocationMREC}}\",\r\n                    \"display\": \"{{LocationName}}\"\r\n                },\r\n                \"authorization\": [\r\n                    {\r\n                        \"reference\": {\r\n                            \"reference\": \"ClinicalImpression/ExampleConclusionMREC\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"patient\": {\r\n                    \"reference\": \"Patient/ExamplePatientWithIdentificationNumber\"\r\n                },\r\n                \"agent\": [\r\n                    {\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/AgentTypeProvenance\",\r\n                                    \"code\": \"organization\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"who\": {\r\n                            \"extension\": [\r\n                                {\r\n                                    \"url\": \"https://fhir.by/StructureDefinition/ExtStringValue\",\r\n                                    \"valueString\": \"{{codeMREC}}\"\r\n                                }\r\n                            ],\r\n                            \"reference\": \"Organization/{{OrganizationMREC}}\",\r\n                            \"display\": \"{{OrganizationName}}\"\r\n                        }\r\n                    },\r\n                    {\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/AgentTypeProvenance\",\r\n                                    \"code\": \"practitioner\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"who\": {\r\n                            \"reference\": \"Practitioner/{{PractitionerMREC}}\",\r\n                            \"display\": \"{{PractitionerName}}\"\r\n                        }\r\n                    },\r\n                    {\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/AgentTypeProvenance\",\r\n                                    \"code\": \"practitionerRole\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"who\": {\r\n                            \"reference\": \"PractitionerRole/{{PractitionerRoleMREC}}\",\r\n                            \"display\": \"{{PractitionerRoleName}}\"\r\n                        }\r\n                    }\r\n                ]\r\n            }\r\n        }\r\n    ]\r\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Bundle/$import",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Bundle",
                    "$import"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Метод получения статуса операции импорта пакета медицинской информации",
              "request": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Bundle/{{bundleId}}/$status",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Bundle",
                    "{{bundleId}}",
                    "$status"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Метод проверки наличия у пациента актуальных заключений МРЭК",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "var jsonData = pm.response.json();\r",
                      "let patientId = jsonData.entry.find(obj => obj.resource.resourceType === \"ClinicalImpression\").resource.id;\r",
                      "\r",
                      "pm.collectionVariables.set(\"clinicalImpressionId\", patientId);\r",
                      "console.log(patientId)\r",
                      ""
                    ],
                    "type": "text/javascript",
                    "packages": {}
                  }
                }
              ],
              "request": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient/{{patientId}}/ClinicalImpression?_profile=https://fhir.by/StructureDefinition/ConclusionMREC&status=completed",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient",
                    "{{patientId}}",
                    "ClinicalImpression"
                  ],
                  "query": [
                    {
                      "key": "_profile",
                      "value": "https://fhir.by/StructureDefinition/ConclusionMREC"
                    },
                    {
                      "key": "status",
                      "value": "completed"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Метод проверка наличия у пациента актуальных индивидуальных программ реабилитации",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "var jsonData = pm.response.json();\r",
                      "let patientId = jsonData.entry.find(obj => obj.resource.resourceType === \"CarePlan\").resource.id;\r",
                      "\r",
                      "pm.collectionVariables.set(\"carePlanId\", patientId);\r",
                      "console.log(patientId)\r",
                      ""
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "protocolProfileBehavior": {
                "disableBodyPruning": true
              },
              "request": {
                "method": "GET",
                "header": [],
                "body": {
                  "mode": "raw",
                  "raw": "",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient/{{patientId}}/CarePlan?_profile=https://fhir.by/StructureDefinition/IPR&status=active",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient",
                    "{{patientId}}",
                    "CarePlan"
                  ],
                  "query": [
                    {
                      "key": "_profile",
                      "value": "https://fhir.by/StructureDefinition/IPR"
                    },
                    {
                      "key": "status",
                      "value": "active"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Поиск Provenance",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "var jsonData = pm.response.json();\r",
                      "let patientId = jsonData.entry.find(obj => obj.resource.resourceType === \"CarePlan\").resource.id;\r",
                      "\r",
                      "pm.collectionVariables.set(\"carePlanId\", patientId);\r",
                      "console.log(patientId)\r",
                      ""
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "protocolProfileBehavior": {
                "disableBodyPruning": true
              },
              "request": {
                "method": "GET",
                "header": [],
                "body": {
                  "mode": "raw",
                  "raw": "",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient/{{patientId}}/Provenance?_profile=https://fhir.by/StructureDefinition/ProvenanceDocumentInfoMREC&_sort=-_lastUpdated",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient",
                    "{{patientId}}",
                    "Provenance"
                  ],
                  "query": [
                    {
                      "key": "_profile",
                      "value": "https://fhir.by/StructureDefinition/ProvenanceDocumentInfoMREC"
                    },
                    {
                      "key": "_sort",
                      "value": "-_lastUpdated"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "сводная информация",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "var jsonData = pm.response.json();\r",
                      "let patientId = jsonData.entry.find(obj => obj.resource.resourceType === \"CarePlan\").resource.id;\r",
                      "\r",
                      "pm.collectionVariables.set(\"carePlanId\", patientId);\r",
                      "console.log(patientId)\r",
                      ""
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "protocolProfileBehavior": {
                "disableBodyPruning": true
              },
              "request": {
                "method": "GET",
                "header": [],
                "body": {
                  "mode": "raw",
                  "raw": "",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient/{{patientId}}/$everything?start=2026-06&end=2026-07",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient",
                    "{{patientId}}",
                    "$everything"
                  ],
                  "query": [
                    {
                      "key": "start",
                      "value": "2026-06"
                    },
                    {
                      "key": "end",
                      "value": "2026-07"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "get-bundle",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "var jsonData = pm.response.json();\r",
                      "let patientId = jsonData.entry.find(obj => obj.resource.resourceType === \"CarePlan\").resource.id;\r",
                      "\r",
                      "pm.collectionVariables.set(\"carePlanId\", patientId);\r",
                      "console.log(patientId)\r",
                      ""
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "protocolProfileBehavior": {
                "disableBodyPruning": true
              },
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "Accept",
                    "value": "text/html",
                    "type": "text",
                    "disabled": true
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Bundle/$get-bundle?identifier={{identifier}}",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Bundle",
                    "$get-bundle"
                  ],
                  "query": [
                    {
                      "key": "identifier",
                      "value": "{{identifier}}"
                    }
                  ]
                }
              },
              "response": []
            }
          ]
        },
        {
          "name": "Кейс 6. Пациент направлен на медико-социальную экспертизу для переосвидетельствования (Досрочное снятие группы инвалидности.)",
          "item": [
            {
              "name": "поиск пациента по идентификационному номеру",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "var jsonData = pm.response.json();\r\nlet patientId = jsonData.entry.find(obj => obj.resource.resourceType === \"Patient\").resource.id;\r\nlet versionId = jsonData.entry.find(obj=> obj.resource.resourceType=== \"Patient\").resource.meta.versionId\r\n\r\npm.collectionVariables.set(\"versionId\", versionId)\r\npm.collectionVariables.set(\"patientId\", patientId);\r\nconsole.log(patientId)\r\nconsole.log(versionId)\r\n"
                    ]
                  }
                }
              ],
              "protocolProfileBehavior": {
                "disableBodyPruning": true
              },
              "request": {
                "method": "GET",
                "header": [],
                "body": {
                  "mode": "raw",
                  "raw": "",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient?identifier=7111071A009PB3",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient"
                  ],
                  "query": [
                    {
                      "key": "identifier",
                      "value": "7111071A009PB3"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Обновление пациента в ЦИСЗ",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Валидный бандл должен отработать со статусом 202\", function () {\r\n    pm.response.to.have.status(202);\r\n});\r\n\r\nvar jsonData = pm.response.json();\r\nlet bundleId = jsonData.parameter.find(obj => obj.name === \"ResourceId\").valueString;\r\nlet statusReference = jsonData.parameter.find(obj => obj.name === \"OperationStatusReference\");\r\n\r\nconsole.log(statusReference.valueReference.reference);\r\n\r\npm.collectionVariables.set(\"bundleId\", bundleId);\r\npm.collectionVariables.set(\"StatusUrl\", statusReference.valueReference.reference);\r\n"
                    ]
                  }
                }
              ],
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Fhir-By-Version",
                    "value": "active"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\r\n    \"resourceType\": \"Patient\",\r\n    \"id\": \"PatientBundleForTest\",\r\n    \"meta\": {\r\n        \"versionId\": \"{{versionId}}\",\r\n        \"profile\": [\r\n            \"https://fhir.by/StructureDefinition/PatientWithIdentificationNumber\"\r\n        ]\r\n    },\r\n    \"identifier\": [\r\n        {\r\n            \"type\": {\r\n                \"coding\": [\r\n                    {\r\n                        \"system\": \"https://fhir.by/ValueSet/PersonalDocumentType\",\r\n                        \"code\": \"INP\"\r\n                    }\r\n                ]\r\n            },\r\n            \"value\": \"7111071A009PB3\"\r\n        },\r\n        {\r\n            \"extension\": [\r\n                {\r\n                    \"extension\": [\r\n                        {\r\n                            \"url\": \"https://fhir.by/StructureDefinition/PassportIssuedString\",\r\n                            \"valueString\": \"Центральным РУВД г Минска, 2024-01-31\"\r\n                        },\r\n                        {\r\n                            \"url\": \"https://fhir.by/StructureDefinition/PassportIssuedDate\",\r\n                            \"valueDate\": \"2024-01-31\"\r\n                        },\r\n                        {\r\n                            \"url\": \"https://fhir.by/StructureDefinition/PassportIssuedCode\",\r\n                            \"valueCodeableConcept\": {\r\n                                \"coding\": [\r\n                                    {\r\n                                        \"system\": \"https://fhir.by/ValueSet/OCAM\",\r\n                                        \"code\": \"106\"\r\n                                    }\r\n                                ]\r\n                            }\r\n                        }\r\n                    ],\r\n                    \"url\": \"https://fhir.by/StructureDefinition/PassportIssued\"\r\n                }\r\n            ],\r\n            \"use\": \"usual\",\r\n            \"type\": {\r\n                \"coding\": [\r\n                    {\r\n                        \"system\": \"https://fhir.by/ValueSet/PersonalDocumentType\",\r\n                        \"code\": \"CDP\"\r\n                    }\r\n                ]\r\n            },\r\n            \"period\": {\r\n                \"start\": \"2025-09-20\"\r\n            },\r\n            \"value\": \"15№ 00013839\",\r\n            \"assigner\": {\r\n                \"reference\": \"Organization/{{OrganizationMREC}}\"\r\n            }\r\n        }\r\n    ],\r\n    \"extension\": [\r\n        {\r\n            \"extension\": [\r\n                {\r\n                    \"url\": \"https://fhir.by/StructureDefinition/PatientJobProfession\",\r\n                    \"valueString\": \"Токарь\"\r\n                },\r\n                {\r\n                    \"url\": \"https://fhir.by/StructureDefinition/PatientJobProfessionCode\",\r\n                    \"valueCodeableConcept\": {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/SpecialtyProfPerson\",\r\n                                \"code\": \"7223-093\",\r\n                                \"display\": \"Токарь-расточник\"\r\n                            }\r\n                        ]\r\n                    }\r\n                },\r\n                {\r\n                    \"url\": \"https://fhir.by/StructureDefinition/PatientJobPlace\",\r\n                    \"valueString\": \"Минский подшипниковый завод\"\r\n                },\r\n                {\r\n                    \"url\": \"https://fhir.by/StructureDefinition/TermOFWork\",\r\n                    \"valuePeriod\": {\r\n                        \"start\": \"2024-01-01\"\r\n                    }\r\n                },\r\n                {\r\n                    \"url\": \"https://fhir.by/StructureDefinition/MainJobPlace\",\r\n                    \"valueBoolean\": true\r\n                }\r\n            ],\r\n            \"url\": \"https://fhir.by/StructureDefinition/PatientJob\"\r\n        },\r\n        {\r\n            \"url\": \"https://fhir.by/StructureDefinition/DisabilityGroup\",\r\n            \"valueCodeableConcept\": {\r\n                \"coding\": [\r\n                    {\r\n                        \"system\": \"https://fhir.by/ValueSet/DisabilityGroup\",\r\n                        \"code\": \"3_group\",\r\n                        \"display\": \"II группа\"\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"url\": \"https://fhir.by/StructureDefinition/DisabilityReason\",\r\n            \"valueCodeableConcept\": {\r\n                \"coding\": [\r\n                    {\r\n                        \"system\": \"https://fhir.by/ValueSet/DisabilityReason\",\r\n                        \"code\": \"general\",\r\n                        \"display\": \"общее заболевание\"\r\n                    }\r\n                ]\r\n            }\r\n        }\r\n    ],\r\n    \"active\": true,\r\n    \"name\": [\r\n        {\r\n            \"family\": \"Иванов\",\r\n            \"given\": [\r\n                \"Петр\",\r\n                \"Сидорович\"\r\n            ]\r\n        }\r\n    ],\r\n    \"telecom\": [\r\n        {\r\n            \"extension\": [\r\n                {\r\n                    \"url\": \"https://fhir.by/StructureDefinition/PatientTelecomPurpose\",\r\n                    \"extension\": [\r\n                        {\r\n                            \"url\": \"https://fhir.by/StructureDefinition/PatientNotificationType\",\r\n                            \"valueCodeableConcept\": {\r\n                                \"coding\": [\r\n                                    {\r\n                                        \"system\": \"https://fhir.by/ValueSet/PatientNotificationType\",\r\n                                        \"code\": \"SMS\"\r\n                                    }\r\n                                ]\r\n                            }\r\n                        },\r\n                        {\r\n                            \"url\": \"https://fhir.by/StructureDefinition/PatientConsentForNotification\",\r\n                            \"valueBoolean\": true\r\n                        }\r\n                    ]\r\n                }\r\n            ],\r\n            \"system\": \"phone\",\r\n            \"value\": \"+375291112233\"\r\n        }\r\n    ],\r\n    \"gender\": \"male\",\r\n    \"birthDate\": \"1990-12-31\",\r\n    \"deceasedBoolean\": false,\r\n    \"address\": [\r\n        {\r\n            \"extension\": [\r\n                {\r\n                    \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                    \"valueCodeableConcept\": {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                \"version\": \"1.51\",\r\n                                \"code\": \"BY\",\r\n                                \"display\": \"Беларусь\"\r\n                            }\r\n                        ]\r\n                    }\r\n                },\r\n                {\r\n                    \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                    \"valueCodeableConcept\": {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                \"version\": \"1.3\",\r\n                                \"code\": \"2938771891184418\"\r\n                            }\r\n                        ]\r\n                    }\r\n                },\r\n                {\r\n                    \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                    \"valueString\": \"кв. 101\"\r\n                }\r\n            ],\r\n            \"use\": \"home\",\r\n            \"text\": \"Витебская область, г. Витебск, Улица 19-я Городокская, д. 5\"\r\n        },\r\n        {\r\n            \"extension\": [\r\n                {\r\n                    \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                    \"valueCodeableConcept\": {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                \"version\": \"1.51\",\r\n                                \"code\": \"BY\",\r\n                                \"display\": \"Беларусь\"\r\n                            }\r\n                        ]\r\n                    }\r\n                },\r\n                {\r\n                    \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                    \"valueCodeableConcept\": {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                \"version\": \"1.3\",\r\n                                \"code\": \"12463236041049757\"\r\n                            }\r\n                        ]\r\n                    }\r\n                },\r\n                {\r\n                    \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                    \"valueString\": \"кв. 1201\"\r\n                }\r\n            ],\r\n            \"use\": \"temp\",\r\n            \"text\": \"Брестская область, г. Пинск, Улица Центральная, д. 9\"\r\n        }\r\n    ]\r\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "импорт пакета медицинских данных",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Валидный бандл должен отработать со статусом 202\", function () {\r\n    pm.response.to.have.status(202);\r\n});\r\n\r\nvar jsonData = pm.response.json();\r\nlet bundleId = jsonData.parameter.find(obj => obj.name === \"ResourceId\").valueString;\r\nlet statusReference = jsonData.parameter.find(obj => obj.name === \"OperationStatusReference\");\r\n\r\nconsole.log(statusReference.valueReference.reference);\r\n\r\npm.collectionVariables.set(\"bundleId\", bundleId);\r\npm.collectionVariables.set(\"StatusUrl\", statusReference.valueReference.reference);\r\n"
                    ]
                  }
                }
              ],
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Fhir-By-Version",
                    "value": "active"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\r\n    \"resourceType\": \"Bundle\",\r\n    \"id\": \"BundleForTest\",\r\n    \"meta\": {\r\n        \"profile\": [\r\n            \"https://fhir.by/AbstractArea/StructureDefinition/Bundle/MedicationDocument\"\r\n        ]\r\n    },\r\n    \"identifier\": {\r\n        \"system\": \"https://fhir.by/ValueSet/urn:ietf:rfc:3986\",\r\n        \"value\": \"urn:uuid:0c3151bd-1cbf-4d64-b04d-{{$guid}}\"\r\n    },\r\n    \"type\": \"document\",\r\n    \"timestamp\": \"2024-04-07T11:30:00Z\",\r\n    \"entry\": [\r\n        {\r\n            \"fullUrl\": \"Composition/CompositionBundleForTest\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Composition\",\r\n                \"id\": \"{{$guid}}\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/CompDocument\"\r\n                    ]\r\n                },\r\n                \"status\": \"registered\",\r\n                \"type\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/CompositionType\",\r\n                            \"code\": \"general\",\r\n                            \"display\": \"Общая медицинская информация\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"subject\": [\r\n                    {\r\n                        \"reference\": \"Patient/PatientBundleForTest\"\r\n                    }\r\n                ],\r\n                \"date\": \"2024-04-07T11:12:21Z\",\r\n                \"author\": [\r\n                    {\r\n                        \"reference\": \"Practitioner/{{PractitionerMREC}}\"\r\n                    }\r\n                ],\r\n                \"title\": \"CompDocument для наполненного Bundle\",\r\n                \"custodian\": {\r\n                    \"reference\": \"Organization/{{OrganizationMREC}}\"\r\n                }\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Patient/PatientBundleForTest\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Patient\",\r\n                \"id\": \"ExamplePatientWithIdentificationNumber\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/PatientED\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/DocumentKind\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/DigitalDocumentKind\",\r\n                                    \"code\": \"00\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    }\r\n                ],\r\n                \"identifier\": [\r\n                    {\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/PersonalDocumentType\",\r\n                                    \"code\": \"INP\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"value\": \"7111071A009PB3\"\r\n                    }\r\n                   \r\n                ],\r\n                \"active\": true,\r\n                \"name\": [\r\n                    {\r\n                        \"family\": \"Иванов\",\r\n                        \"given\": [\r\n                            \"Петр\",\r\n                            \"Сидорович\"\r\n                        ]\r\n                    }\r\n                ],\r\n                \"birthDate\": \"1990-12-31\",\r\n                \"gender\": \"male\",\r\n                \"telecom\": [\r\n                    {\r\n                        \"system\": \"phone\",\r\n                        \"value\": \"+375291112233\"\r\n                    }\r\n                ],\r\n                \"address\": [\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                            \"version\": \"1.51\",\r\n                                            \"code\": \"BY\",\r\n                                            \"display\": \"Беларусь\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                            \"version\": \"1.3\",\r\n                                            \"code\": \"2938771891184418\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                                \"valueString\": \"кв. 101\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"home\",\r\n                        \"text\": \"Витебская область, г. Витебск, Улица 19-я Городокская, д. 5\"\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                            \"version\": \"1.51\",\r\n                                            \"code\": \"BY\",\r\n                                            \"display\": \"Беларусь\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                            \"version\": \"1.3\",\r\n                                            \"code\": \"12463236041049757\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                                \"valueString\": \"кв. 1201\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"temp\",\r\n                        \"text\": \"Брестская область, г. Пинск, Улица Центральная, д. 9\"\r\n                    }\r\n                ],\r\n                \"link\": [\r\n                    {\r\n                        \"other\": {\r\n                            \"reference\": \"Patient/{{patientId}}\"\r\n                        },\r\n                        \"type\": \"refer\"\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Encounter/EncounterBundleForTest\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Encounter\",\r\n                \"id\": \"ExampleEncounterForMREC\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/EncounterGeneral\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/EncouterMRECConcent\",\r\n                        \"valueBoolean\": true\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/DisabilityFirstTime\",\r\n                        \"valueBoolean\": true\r\n                    }\r\n                ],\r\n                \"identifier\": [\r\n                    {\r\n                        \"value\": \"1235\",\r\n                        \"assigner\": {\r\n                            \"reference\": \"Organization/{{OrganizationMREC}}\",\r\n                            \"display\": \"Учреждение здравоохранения \\\"Витебская областная медико-реабилитационная экспертная комиссия\\\"\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"status\": \"completed\",\r\n                \"class\": [\r\n                    {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/VSTermsOfService\",\r\n                                \"code\": \"1\"\r\n                            }\r\n                        ]\r\n                    }\r\n                ],\r\n                \"priority\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/HealthCareForms\",\r\n                            \"code\": \"planned\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"type\": [\r\n                    {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/TypeOfHealthCare\",\r\n                                \"code\": \"special\"\r\n                            }\r\n                        ]\r\n                    }\r\n                ],\r\n                \"subject\": {\r\n                    \"reference\": \"Patient/{{patientId}}\"\r\n                },\r\n                \"serviceProvider\": {\r\n                    \"reference\": \"Organization/{{OrganizationMREC}}\"\r\n                },\r\n                \"actualPeriod\": {\r\n                    \"start\": \"2026-09-15T10:10:21Z\",\r\n                    \"end\": \"2026-09-15T12:00:21Z\"\r\n                },\r\n                \"participant\": [\r\n                    {\r\n                        \"actor\": {\r\n                            \"reference\": \"PractitionerRole/{{PractitionerRoleMREC}}\",\r\n                            \"display\": \"Иванов Владислав Эдуардович\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"diagnosis\": [\r\n                    {\r\n                        \"condition\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"Condition/ExampleDiagnosisMREC\"\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"use\": [\r\n                            {\r\n                                \"coding\": [\r\n                                    {\r\n                                        \"system\": \"https://fhir.by/ValueSet/TypeOfDiagnosis\",\r\n                                        \"code\": \"mainDiagnosis\"\r\n                                    }\r\n                                ]\r\n                            }\r\n                        ]\r\n                    },\r\n                    {\r\n                        \"condition\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"Condition/ExampleDiagnosisMREC1\"\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"use\": [\r\n                            {\r\n                                \"coding\": [\r\n                                    {\r\n                                        \"system\": \"https://fhir.by/ValueSet/TypeOfDiagnosis\",\r\n                                        \"code\": \"additionalDiagnosis\"\r\n                                    }\r\n                                ]\r\n                            }\r\n                        ]\r\n                    }\r\n                ],\r\n                \"location\": [\r\n                    {\r\n                        \"location\": {\r\n                            \"reference\": \"Location/{{LocationMREC}}\"\r\n                        }\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Condition/ExampleDiagnosisMREC\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Condition\",\r\n                \"id\": \"ExampleDiagnosisMREC\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/FinalDiagnosis\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/KindOfDiagnosis\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/KindOfDiagnosisCode\",\r\n                                    \"code\": \"Сlinical-functional\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/AssertedDate\",\r\n                        \"valueDateTime\": \"2024-09-01\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/FirstTimeRevealed\",\r\n                        \"valueBoolean\": true\r\n                    }\r\n                ],\r\n                \"clinicalStatus\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"http://terminology.hl7.org/CodeSystem/condition-clinical\",\r\n                            \"code\": \"active\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"code\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/InternClassificDiseases10\",\r\n                            \"code\": \"M17.3\",\r\n                            \"display\": \"Другие посттравматические гонартрозы\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"subject\": {\r\n                    \"reference\": \"Patient/{{patientId}}\"\r\n                },\r\n                \"onsetDateTime\": \"2026-09-01\",\r\n                \"recordedDate\": \"2026-09-01\",\r\n                \"participant\": [\r\n                    {\r\n                        \"actor\": {\r\n                            \"reference\": \"PractitionerRole/{{PractitionerRoleMREC}}\",\r\n                            \"display\": \"Иванов Владислав Эдуардович\"\r\n                        }\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Condition/ExampleDiagnosisMREC1\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Condition\",\r\n                \"id\": \"ExampleDiagnosisMREC\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/FinalDiagnosis\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/KindOfDiagnosis\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/KindOfDiagnosisCode\",\r\n                                    \"code\": \"Сlinical-functional\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/AssertedDate\",\r\n                        \"valueDateTime\": \"2026-09-01\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/FirstTimeRevealed\",\r\n                        \"valueBoolean\": true\r\n                    }\r\n                ],\r\n                \"clinicalStatus\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"http://terminology.hl7.org/CodeSystem/condition-clinical\",\r\n                            \"code\": \"active\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"code\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/InternClassificDiseases10\",\r\n                            \"code\": \"Z96.6\",\r\n                            \"display\": \"Наличие ортопедических имплантатов суставов\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"subject\": {\r\n                    \"reference\": \"Patient/{{patientId}}\"\r\n                },\r\n                \"onsetDateTime\": \"2026-09-01\",\r\n                \"recordedDate\": \"2026-09-01\",\r\n                \"participant\": [\r\n                    {\r\n                        \"actor\": {\r\n                            \"reference\": \"PractitionerRole/{{PractitionerRoleMREC}}\",\r\n                            \"display\": \"Иванов Владислав Эдуардович\"\r\n                        }\r\n                    }\r\n                ]\r\n            }\r\n        }\r\n    ]\r\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Bundle/$import",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Bundle",
                    "$import"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "получение статуса импорта пакета медицинских данных",
              "request": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Bundle/{{bundleId}}/$status",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Bundle",
                    "{{bundleId}}",
                    "$status"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "поиск пациента по идентификационному номеру",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "var jsonData = pm.response.json();\r\nlet patientId = jsonData.entry.find(obj => obj.resource.resourceType === \"Patient\").resource.id;\r\n\r\npm.collectionVariables.set(\"patientId\", patientId);\r\nconsole.log(patientId)\r\n"
                    ]
                  }
                }
              ],
              "protocolProfileBehavior": {
                "disableBodyPruning": true
              },
              "request": {
                "method": "GET",
                "header": [],
                "body": {
                  "mode": "raw",
                  "raw": "",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient?identifier=7111071A009PB3",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient"
                  ],
                  "query": [
                    {
                      "key": "identifier",
                      "value": "7111071A009PB3"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Поиск обращения пациента к врачу",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "var jsonData = pm.response.json();\r\n\r\n// Фильтруем только Encounter ресурсы, исключая OperationOutcome\r\nlet encounterEntries = jsonData.entry.filter(entry => \r\n    entry.resource && entry.resource.resourceType === \"Encounter\"\r\n);\r\n\r\nif (encounterEntries.length > 0) {\r\n    // Сортируем по дате lastUpdated (от новых к старым) и берем самый свежий\r\n    encounterEntries.sort((a, b) => \r\n        new Date(b.resource.meta.lastUpdated) - new Date(a.resource.meta.lastUpdated)\r\n    );\r\n    \r\n    let latestEncounter = encounterEntries[0];\r\n    let encounterId = latestEncounter.resource.id;\r\n    pm.collectionVariables.set(\"encounterId\", encounterId);\r\n    console.log(\"Latest encounterId:\", encounterId);\r\n    console.log(\"Last updated:\", latestEncounter.resource.meta.lastUpdated);\r\n} else {\r\n    console.log(\"No Encounter resources found in response\");\r\n}"
                    ]
                  }
                }
              ],
              "protocolProfileBehavior": {
                "disableBodyPruning": true
              },
              "request": {
                "method": "GET",
                "header": [],
                "body": {
                  "mode": "raw",
                  "raw": "",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient/{{patientId}}/Encounter?_profile=https://fhir.by/StructureDefinition/EncounterGeneral&patient={{patientId}}&_sort=-_lastUpdated",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient",
                    "{{patientId}}",
                    "Encounter"
                  ],
                  "query": [
                    {
                      "key": "_profile",
                      "value": "https://fhir.by/StructureDefinition/EncounterGeneral"
                    },
                    {
                      "key": "patient",
                      "value": "{{patientId}}"
                    },
                    {
                      "key": "_sort",
                      "value": "-_lastUpdated"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Поиск диагноза пациента к врачу",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "var jsonData = pm.response.json();\r\nlet conditionId = jsonData.entry.find(obj => obj.resource.resourceType === \"Condition\").resource.id;\r\n\r\npm.collectionVariables.set(\"conditionId\", conditionId);\r\nconsole.log(conditionId)\r\n"
                    ]
                  }
                }
              ],
              "protocolProfileBehavior": {
                "disableBodyPruning": true
              },
              "request": {
                "method": "GET",
                "header": [],
                "body": {
                  "mode": "raw",
                  "raw": "",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient/{{patientId}}/Condition?_profile=https://fhir.by/StructureDefinition/FinalDiagnosis&_sort=-_lastUpdated",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient",
                    "{{patientId}}",
                    "Condition"
                  ],
                  "query": [
                    {
                      "key": "_profile",
                      "value": "https://fhir.by/StructureDefinition/FinalDiagnosis"
                    },
                    {
                      "key": "_sort",
                      "value": "-_lastUpdated"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Метод получения идентификатора электронного документа",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "var jsonData = pm.response.json();\r\nlet identifier = jsonData.parameter.find(obj => obj.name === \"identifier\").valueString;\r\npm.collectionVariables.set(\"identifier\", identifier);\r\nconsole.log(identifier)"
                    ]
                  }
                }
              ],
              "request": {
                "method": "POST",
                "header": [],
                "body": {
                  "mode": "raw",
                  "raw": "{\r\n    \"resourceType\": \"Parameters\",\r\n    \"parameter\": [\r\n        {\r\n            \"name\": \"document-code\",\r\n            \"valueCoding\": {\r\n                \"system\": \"https://fhir.by/ValueSet/DigitalDocumentKind\",\r\n                \"code\": \"04\"\r\n            }\r\n        }\r\n    ]\r\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/$get-document-id",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "$get-document-id"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Метод импорта пакета медицинской информации (заключение МРЭК)",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"Валидный бандл должен отработать со статусом 202\", function () {\r\n    pm.response.to.have.status(202);\r\n});\r\n\r\nvar jsonData = pm.response.json();\r\nlet bundleId = jsonData.parameter.find(obj => obj.name === \"ResourceId\").valueString;\r\nlet statusReference = jsonData.parameter.find(obj => obj.name === \"OperationStatusReference\");\r\n\r\nconsole.log(statusReference.valueReference.reference);\r\n\r\npm.collectionVariables.set(\"bundleId\", bundleId);\r\npm.collectionVariables.set(\"StatusUrl\", statusReference.valueReference.reference);\r\n"
                    ]
                  }
                }
              ],
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Fhir-By-Version",
                    "value": "active"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\r\n    \"resourceType\": \"Bundle\",\r\n    \"id\": \"BundleConclusionMRECDisability190110\",\r\n    \"meta\": {\r\n        \"profile\": [\r\n            \"https://fhir.by/AbstractArea/StructureDefinition/Bundle/BundleMREC\"\r\n        ]\r\n    },\r\n    \"identifier\": {\r\n        \"system\": \"https://minzdrav.gov.by\",\r\n        \"value\": \"{{identifier}}\"\r\n    },\r\n    \"type\": \"document\",\r\n    \"timestamp\": \"2024-09-01T11:12:21Z\",\r\n    \"entry\": [\r\n        {\r\n            \"fullUrl\": \"Composition/ExampleCompositionMRECDisability\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Composition\",\r\n                \"id\": \"ExampleCompositionMRECDisability\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/DocumentMREC\"\r\n                    ]\r\n                },\r\n                \"status\": \"final\",\r\n                \"type\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/CompositionType\",\r\n                            \"code\": \"conclusion-mrec\",\r\n                            \"display\": \"Заключение МРЭК\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"subject\": [\r\n                    {\r\n                        \"reference\": \"Patient/ExamplePatientWithIdentificationNumber\"\r\n                    }\r\n                ],\r\n                \"date\": \"2024-09-01T11:12:21Z\",\r\n                \"author\": [\r\n                    {\r\n                        \"reference\": \"Practitioner/{{PractitionerMREC}}\"\r\n                    }\r\n                ],\r\n                \"title\": \"Уточненный состав необходимых данных о лице, предоставляемых медико-реабилитационными экспертными комиссиями\",\r\n                \"custodian\": {\r\n                    \"reference\": \"Organization/{{OrganizationMREC}}\"\r\n                },\r\n                \"event\": [\r\n                    {\r\n                        \"detail\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"ClinicalImpression/ExampleConclusionMREC\"\r\n                                }\r\n                            }\r\n                        ]\r\n                    }\r\n                    \r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Patient/ExamplePatientWithIdentificationNumber\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Patient\",\r\n                \"id\": \"ExamplePatientWithIdentificationNumber\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/PatientED\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/DocumentKind\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/DigitalDocumentKind\",\r\n                                    \"code\": \"04\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    }\r\n                ],\r\n                \"identifier\": [\r\n                    {\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/PersonalDocumentType\",\r\n                                    \"code\": \"INP\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"value\": \"7111071A009PB3\"\r\n                    }\r\n                ],\r\n                \"active\": true,\r\n                \"name\": [\r\n                    {\r\n                        \"family\": \"Иванов\",\r\n                        \"given\": [\r\n                            \"Петр\",\r\n                            \"Сидорович\"\r\n                        ]\r\n                    }\r\n                ],\r\n                \"birthDate\": \"1990-12-31\",\r\n                \"telecom\": [\r\n                    {\r\n                        \"system\": \"phone\",\r\n                        \"value\": \"+375291112233\"\r\n                    }\r\n                ],\r\n                \"address\": [\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                            \"version\": \"1.51\",\r\n                                            \"code\": \"BY\",\r\n                                            \"display\": \"Беларусь\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                            \"version\": \"1.3\",\r\n                                            \"code\": \"2938771891184418\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                                \"valueString\": \"кв. 101\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"home\",\r\n                        \"text\": \"Витебская область, г. Витебск, Улица 19-я Городокская, д. 5\"\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                            \"version\": \"1.51\",\r\n                                            \"code\": \"BY\",\r\n                                            \"display\": \"Беларусь\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                            \"version\": \"1.3\",\r\n                                            \"code\": \"12463236041049757\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                                \"valueString\": \"кв. 1201\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"temp\",\r\n                        \"text\": \"Брестская область, г. Пинск, Улица Центральная, д. 9\"\r\n                    }\r\n                ],\r\n                \"link\": [\r\n                    {\r\n                        \"other\": {\r\n                            \"reference\": \"Patient/{{patientId}}\"\r\n                        },\r\n                        \"type\": \"refer\"\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"ClinicalImpression/ExampleConclusionMREC\",\r\n            \"resource\": {\r\n                \"resourceType\": \"ClinicalImpression\",\r\n                \"id\": \"ExampleConclusionMREC\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/ConclusionMREC\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CodesReasonForMREC\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/ReasonForMREC\",\r\n                                            \"code\": \"anticipatorily\",\r\n                                            \"display\": \"переосвидетельствование пациента ранее установленного срока\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"url\": \"https://fhir.by/StructureDefinition/ReasonForMREC\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/ExtSurveyTypeMREC\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/SurveyTypeMREC\",\r\n                                    \"code\": \"10\",\r\n                                    \"display\": \"повторное очное\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                  \r\n                   \r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/DisabilityGroup\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/DisabilityGroup\",\r\n                                    \"code\": \"no_disability\",\r\n                                    \"display\": \"инвалидность не установлена\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                   \r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/ProgramRehabilitionMREC\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/ProgramRehabilitionMREC\",\r\n                                    \"code\": \"noipra\",\r\n                                    \"display\": \"индивидуальная программа реабилитации, абилитации не формировалась\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    }\r\n                ],\r\n                \"encounter\": {\r\n                    \"reference\": \"Encounter/{{encounterId}}\"\r\n                },\r\n                \"identifier\": [\r\n                    {\r\n                        \"value\": \"{{identifier}}\",\r\n                        \"period\": {\r\n                            \"start\": \"2026-09-20\",\r\n                            \"end\": \"2027-09-20\"\r\n                        },\r\n                        \"assigner\": {\r\n                            \"extension\": [\r\n                                {\r\n                                    \"url\": \"https://fhir.by/StructureDefinition/LocationReference\",\r\n                                    \"valueReference\": {\r\n                                        \"reference\": \"Location/{{LocationMREC}}\"\r\n                                    }\r\n                                }\r\n                            ],\r\n                            \"reference\": \"Organization/{{OrganizationMREC}}\",\r\n                            \"display\": \"{{OrganizationName}}\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"status\": \"completed\",\r\n               \r\n                \"subject\": {\r\n                    \"reference\": \"Patient/ExamplePatientWithIdentificationNumber\"\r\n                },\r\n                \"effectiveDateTime\": \"2026-09-25\",\r\n                \"description\":\"Инвалидность не установлена\",\r\n                \"date\": \"2026-09-20\",\r\n                \"performer\": {\r\n                    \"reference\": \"PractitionerRole/{{PractitionerRoleMREC}}\"\r\n                }\r\n            }\r\n        },\r\n        \r\n        {\r\n            \"fullUrl\": \"Provenance/ExampleProvenanceDocumentInfoMRECDisability\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Provenance\",\r\n                \"id\": \"ExampleProvenanceDocumentInfoMRECDisability\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/ProvenanceDocumentInfoMREC\"\r\n                    ]\r\n                },\r\n                \"target\": [\r\n                    {\r\n                        \"reference\": \"Patient/ExamplePatientWithIdentificationNumber\"\r\n                    }\r\n                ],\r\n                \"recorded\": \"2024-09-20T11:12:21Z\",\r\n                \"location\": {\r\n                    \"extension\": [\r\n                        {\r\n                            \"url\": \"https://fhir.by/StructureDefinition/ExtStringValue\",\r\n                            \"valueString\": \"{{codeMrecLocation}}\"\r\n                        }\r\n                    ],\r\n                    \"reference\": \"Location/{{LocationMREC}}\",\r\n                    \"display\": \"{{LocationName}}\"\r\n                },\r\n                \"authorization\": [\r\n                    {\r\n                        \"reference\": {\r\n                            \"reference\": \"ClinicalImpression/ExampleConclusionMREC\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"patient\": {\r\n                    \"reference\": \"Patient/ExamplePatientWithIdentificationNumber\"\r\n                },\r\n                \"agent\": [\r\n                    {\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/AgentTypeProvenance\",\r\n                                    \"code\": \"organization\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"who\": {\r\n                            \"extension\": [\r\n                                {\r\n                                    \"url\": \"https://fhir.by/StructureDefinition/ExtStringValue\",\r\n                                    \"valueString\": \"{{codeMREC}}\"\r\n                                }\r\n                            ],\r\n                            \"reference\": \"Organization/{{OrganizationMREC}}\",\r\n                            \"display\": \"{{OrganizationName}}\"\r\n                        }\r\n                    },\r\n                    {\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/AgentTypeProvenance\",\r\n                                    \"code\": \"practitioner\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"who\": {\r\n                            \"reference\": \"Practitioner/{{PractitionerMREC}}\",\r\n                            \"display\": \"{{PractitionerName}}\"\r\n                        }\r\n                    },\r\n                    {\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/AgentTypeProvenance\",\r\n                                    \"code\": \"practitionerRole\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"who\": {\r\n                            \"reference\": \"PractitionerRole/{{PractitionerRoleMREC}}\",\r\n                            \"display\": \"{{PractitionerRoleName}}\"\r\n                        }\r\n                    }\r\n                ]\r\n            }\r\n        }\r\n    ]\r\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Bundle/$import",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Bundle",
                    "$import"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Метод получения статуса операции импорта пакета медицинской информации",
              "request": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Bundle/{{bundleId}}/$status",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Bundle",
                    "{{bundleId}}",
                    "$status"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Метод проверки наличия у пациента актуальных заключений МРЭК",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "var jsonData = pm.response.json();\r\nlet patientId = jsonData.entry.find(obj => obj.resource.resourceType === \"ClinicalImpression\").resource.id;\r\n\r\npm.collectionVariables.set(\"clinicalImpressionId\", patientId);\r\nconsole.log(patientId)\r\n"
                    ]
                  }
                }
              ],
              "request": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient/{{patientId}}/ClinicalImpression?_profile=https://fhir.by/StructureDefinition/ConclusionMREC&status=completed&_sort=-_lastUpdated",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient",
                    "{{patientId}}",
                    "ClinicalImpression"
                  ],
                  "query": [
                    {
                      "key": "_profile",
                      "value": "https://fhir.by/StructureDefinition/ConclusionMREC"
                    },
                    {
                      "key": "status",
                      "value": "completed"
                    },
                    {
                      "key": "_sort",
                      "value": "-_lastUpdated"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Поиск Provenance",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "var jsonData = pm.response.json();\r",
                      "let patientId = jsonData.entry.find(obj => obj.resource.resourceType === \"CarePlan\").resource.id;\r",
                      "\r",
                      "pm.collectionVariables.set(\"carePlanId\", patientId);\r",
                      "console.log(patientId)\r",
                      ""
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "protocolProfileBehavior": {
                "disableBodyPruning": true
              },
              "request": {
                "method": "GET",
                "header": [],
                "body": {
                  "mode": "raw",
                  "raw": "",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient/{{patientId}}/Provenance?_profile=https://fhir.by/StructureDefinition/ProvenanceDocumentInfoMREC&_sort=-_lastUpdated",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient",
                    "{{patientId}}",
                    "Provenance"
                  ],
                  "query": [
                    {
                      "key": "_profile",
                      "value": "https://fhir.by/StructureDefinition/ProvenanceDocumentInfoMREC"
                    },
                    {
                      "key": "_sort",
                      "value": "-_lastUpdated"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "сводная информация",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "var jsonData = pm.response.json();\r",
                      "let patientId = jsonData.entry.find(obj => obj.resource.resourceType === \"CarePlan\").resource.id;\r",
                      "\r",
                      "pm.collectionVariables.set(\"carePlanId\", patientId);\r",
                      "console.log(patientId)\r",
                      ""
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "protocolProfileBehavior": {
                "disableBodyPruning": true
              },
              "request": {
                "method": "GET",
                "header": [],
                "body": {
                  "mode": "raw",
                  "raw": "",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient/{{patientId}}/$everything?start=2026-06&end=2026-07",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient",
                    "{{patientId}}",
                    "$everything"
                  ],
                  "query": [
                    {
                      "key": "start",
                      "value": "2026-06"
                    },
                    {
                      "key": "end",
                      "value": "2026-07"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "get-bundle",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "var jsonData = pm.response.json();\r\nlet patientId = jsonData.entry.find(obj => obj.resource.resourceType === \"CarePlan\").resource.id;\r\n\r\npm.collectionVariables.set(\"carePlanId\", patientId);\r\nconsole.log(patientId)\r\n"
                    ]
                  }
                }
              ],
              "protocolProfileBehavior": {
                "disableBodyPruning": true
              },
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "Accept",
                    "value": "text/html"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                },
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Bundle/$get-bundle?identifier={{identifier}}",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Bundle",
                    "$get-bundle"
                  ],
                  "query": [
                    {
                      "key": "identifier",
                      "value": "{{identifier}}"
                    }
                  ]
                }
              },
              "response": []
            }
          ]
        },
        {
          "name": "Кейс 7. Получение и просмотр врачом визуального представления заключения МРЭК",
          "item": [
            {
              "name": "Поиск бандла",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "var jsonData = pm.response.json();\r",
                      "let bundleIdentifier = jsonData.entry.find(obj => obj.resource.resourceType === \"Bundle\").resource.identifier.value;\r",
                      "\r",
                      "pm.collectionVariables.set(\"bundleIdentifier\", bundleIdentifier);\r",
                      "console.log(bundleIdentifier)\r",
                      ""
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "request": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Bundle?patient={{patientId}}&_profile=https://fhir.by/AbstractArea/StructureDefinition/Bundle/BundleMREC&_sort=-_lastUpdated",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Bundle"
                  ],
                  "query": [
                    {
                      "key": "patient",
                      "value": "{{patientId}}"
                    },
                    {
                      "key": "_profile",
                      "value": "https://fhir.by/AbstractArea/StructureDefinition/Bundle/BundleMREC"
                    },
                    {
                      "key": "_sort",
                      "value": "-_lastUpdated"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Поиск бандла через операцию get-bundle",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "var jsonData = pm.response.json();\r",
                      "let bundleIdentifier = jsonData.entry.find(obj => obj.resource.resourceType === \"Bundle\").resource.identifier.value;\r",
                      "\r",
                      "pm.collectionVariables.set(\"bundleIdentifier\", bundleIdentifier);\r",
                      "console.log(bundleIdentifier)\r",
                      ""
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "Accept",
                    "value": "text/html",
                    "type": "text",
                    "disabled": true
                  },
                  {
                    "key": "Accept",
                    "value": "application/json",
                    "type": "text",
                    "disabled": true
                  },
                  {
                    "key": "Accept",
                    "value": "application/cms",
                    "type": "text",
                    "disabled": true
                  }
                ],
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Bundle/$get-bundle?identifier={{bundleIdentifier}}",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Bundle",
                    "$get-bundle"
                  ],
                  "query": [
                    {
                      "key": "identifier",
                      "value": "{{bundleIdentifier}}"
                    }
                  ]
                }
              },
              "response": []
            }
          ]
        },
        {
          "name": "Методы проверки выполнения требований поиска FHIR-ресурсов «ClinicalImpression», «CarePlan» в контексте пациента",
          "item": [
            {
              "name": "Метод проверки выполнения требований поиска FHIR-ресурса «ClinicalImpression» в контексте пациента по основным поисковым параметрам",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "var jsonData = pm.response.json();\r",
                      "let patientId = jsonData.entry.find(obj => obj.resource.resourceType === \"ClinicalImpression\").resource.id;\r",
                      "\r",
                      "pm.collectionVariables.set(\"clinicalImpressionId\", patientId);\r",
                      "console.log(patientId)\r",
                      ""
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "request": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient/{{patientId}}/ClinicalImpression?_profile=https://fhir.by/StructureDefinition/ConclusionMREC&subject={{patientId}}&performer={{PractitionerRoleMREC}}&assigner={{OrganizationMREC}}&date=2024-09-20&identifier={{identifier}}&identifier-period=ge2024-09",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient",
                    "{{patientId}}",
                    "ClinicalImpression"
                  ],
                  "query": [
                    {
                      "key": "_profile",
                      "value": "https://fhir.by/StructureDefinition/ConclusionMREC"
                    },
                    {
                      "key": "subject",
                      "value": "{{patientId}}"
                    },
                    {
                      "key": "performer",
                      "value": "{{PractitionerRoleMREC}}"
                    },
                    {
                      "key": "assigner",
                      "value": "{{OrganizationMREC}}"
                    },
                    {
                      "key": "date",
                      "value": "2024-09-20"
                    },
                    {
                      "key": "identifier",
                      "value": "{{identifier}}",
                      "type": "text"
                    },
                    {
                      "key": "identifier-period",
                      "value": "ge2024-09",
                      "type": "text"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Метод проверки выполнения требований поиска FHIR-ресурса «CarePlan» в контексте пациента по основным поисковым параметрам",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "var jsonData = pm.response.json();\r",
                      "let patientId = jsonData.entry.find(obj => obj.resource.resourceType === \"CarePlan\").resource.id;\r",
                      "\r",
                      "pm.collectionVariables.set(\"carePlanId\", patientId);\r",
                      "console.log(patientId)\r",
                      ""
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "request": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient/{{patientId}}/CarePlan?_profile=https://fhir.by/StructureDefinition/IPR&patient={{patientId}}&subject={{patientId}}&author={{PractitionerRoleMREC}}&status=active&custodian={{OrganizationMREC}}&identifier={{identifier}}",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient",
                    "{{patientId}}",
                    "CarePlan"
                  ],
                  "query": [
                    {
                      "key": "_profile",
                      "value": "https://fhir.by/StructureDefinition/IPR"
                    },
                    {
                      "key": "patient",
                      "value": "{{patientId}}"
                    },
                    {
                      "key": "subject",
                      "value": "{{patientId}}"
                    },
                    {
                      "key": "author",
                      "value": "{{PractitionerRoleMREC}}"
                    },
                    {
                      "key": "status",
                      "value": "active"
                    },
                    {
                      "key": "custodian",
                      "value": "{{OrganizationMREC}}"
                    },
                    {
                      "key": "identifier",
                      "value": "{{identifier}}",
                      "type": "text"
                    }
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Поиск Сводной информации о пациенте",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      "var jsonData = pm.response.json();\r",
                      "let patientId = jsonData.entry.find(obj => obj.resource.resourceType === \"CarePlan\").resource.id;\r",
                      "\r",
                      "pm.collectionVariables.set(\"carePlanId\", patientId);\r",
                      "console.log(patientId)\r",
                      ""
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "request": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient/{{patientId}}/$everything?start=2024-09&end=2024-10",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient",
                    "{{patientId}}",
                    "$everything"
                  ],
                  "query": [
                    {
                      "key": "start",
                      "value": "2024-09"
                    },
                    {
                      "key": "end",
                      "value": "2024-10"
                    }
                  ]
                }
              },
              "response": []
            }
          ]
        },
        {
          "name": "Методы проверки выполнения требований получения FHIR-ресурсов «ClinicalImpression», «CarePlan» в контексте пациента",
          "item": [
            {
              "name": "Метод проверки выполнения требований получения FHIR-ресурса «ClinicalImpression» в контексте пациента по логическому идентификатору",
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "exec": [
                      ""
                    ],
                    "type": "text/javascript",
                    "packages": {},
                    "requests": {}
                  }
                }
              ],
              "request": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient/{{patientId}}/ClinicalImpression/{{clinicalImpressionId}}",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient",
                    "{{patientId}}",
                    "ClinicalImpression",
                    "{{clinicalImpressionId}}"
                  ]
                }
              },
              "response": []
            },
            {
              "name": "Метод проверки выполнения требований получения FHIR-ресурса «CarePlan» в контексте пациента по логическому идентификатору",
              "request": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{Schema}}://{{Proxy-host}}/fhir/Patient/{{patientId}}/CarePlan/{{carePlanId}}",
                  "protocol": "{{Schema}}",
                  "host": [
                    "{{Proxy-host}}"
                  ],
                  "path": [
                    "fhir",
                    "Patient",
                    "{{patientId}}",
                    "CarePlan",
                    "{{carePlanId}}"
                  ]
                }
              },
              "response": []
            }
          ]
        }
      ],
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "packages": {},
            "requests": {},
            "exec": [
              ""
            ]
          }
        },
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "packages": {},
            "requests": {},
            "exec": [
              ""
            ]
          }
        }
      ]
    }
  ],
  "auth": {
    "type": "oauth2",
    "oauth2": [
      {
        "key": "useBrowser",
        "value": false,
        "type": "boolean"
      },
      {
        "key": "clientId",
        "value": "mis_agsr_web_application",
        "type": "string"
      },
      {
        "key": "authUrl",
        "value": "https://preprod.cisz.by/auth/api/realms/iehr/auth",
        "type": "string"
      },
      {
        "key": "accessTokenUrl",
        "value": "https://preprod.cisz.by/auth/api/realms/iehr/token",
        "type": "string"
      },
      {
        "key": "tokenName",
        "value": "iehr",
        "type": "string"
      },
      {
        "key": "refreshRequestParams",
        "value": [],
        "type": "any"
      },
      {
        "key": "tokenRequestParams",
        "value": [
          {
            "key": "Origin",
            "value": "https://oauth.pstmn.io/v1/callback",
            "enabled": true,
            "send_as": "request_header"
          }
        ],
        "type": "any"
      },
      {
        "key": "authRequestParams",
        "value": [],
        "type": "any"
      },
      {
        "key": "challengeAlgorithm",
        "value": "S256",
        "type": "string"
      },
      {
        "key": "redirect_uri",
        "value": "https://oauth.pstmn.io/v1/callback",
        "type": "string"
      },
      {
        "key": "grant_type",
        "value": "authorization_code_with_pkce",
        "type": "string"
      },
      {
        "key": "addTokenTo",
        "value": "header",
        "type": "string"
      },
      {
        "key": "client_authentication",
        "value": "body",
        "type": "string"
      }
    ]
  },
  "event": [
    {
      "listen": "prerequest",
      "script": {
        "type": "text/javascript",
        "packages": {},
        "requests": {},
        "exec": [
          "// // Pre-request script for collection - automatically detects active version\r",
          "// const schema = pm.collectionVariables.get('Schema') || 'https';\r",
          "// const host = pm.collectionVariables.get('Proxy-host') || 'pp.cisz.by';\r",
          "\r",
          "// // Function to extract version from implementationGuide URL\r",
          "// function extractVersionFromUrl(url) {\r",
          "//     const versionMatch = url.match(/\\/(\\d+\\.\\d+\\.\\d+)\\?status=Active/);\r",
          "//     return versionMatch ? versionMatch[1] : null;\r",
          "// }\r",
          "\r",
          "// // Function to add header\r",
          "// function addFhirVersionHeader(version) {\r",
          "//     if (version && !pm.request.headers.has('X-Fhir-By-Version')) {\r",
          "//         pm.request.headers.add({\r",
          "//             key: 'X-Fhir-By-Version',\r",
          "//             value: version\r",
          "//         });\r",
          "//         console.log('✅ X-Fhir-By-Version header added:', version);\r",
          "//         return true;\r",
          "//     }\r",
          "//     return false;\r",
          "// }\r",
          "\r",
          "// // Main execution - using synchronous approach\r",
          "// try {\r",
          "//     // Check if we already have a cached version\r",
          "//     const cachedVersion = pm.collectionVariables.get('ActiveFhirVersion');\r",
          "    \r",
          "//     if (cachedVersion) {\r",
          "//         console.log('Using cached FHIR version:', cachedVersion);\r",
          "//         addFhirVersionHeader(cachedVersion);\r",
          "//     } else {\r",
          "//         // Since we can't do synchronous HTTP requests in pre-request script,\r",
          "//         // we'll use the known active version from the metadata response\r",
          "//         const knownActiveVersion = \"1.3.5260\";\r",
          "        \r",
          "//         console.log('Using known active FHIR version:', knownActiveVersion);\r",
          "//         if (addFhirVersionHeader(knownActiveVersion)) {\r",
          "//             // Cache it for future requests\r",
          "//             pm.collectionVariables.set('ActiveFhirVersion', knownActiveVersion);\r",
          "//         }\r",
          "//     }\r",
          "// } catch (error) {\r",
          "//     console.log('Error in pre-request script:', error);\r",
          "//     // Fallback to known version\r",
          "//     addFhirVersionHeader(\"1.3.5260\");\r",
          "// }"
        ]
      }
    },
    {
      "listen": "test",
      "script": {
        "type": "text/javascript",
        "packages": {},
        "requests": {},
        "exec": [
          ""
        ]
      }
    }
  ],
  "variable": [
    {
      "key": "patientId",
      "value": ""
    },
    {
      "key": "bundleId",
      "value": ""
    },
    {
      "key": "StatusUrl",
      "value": ""
    },
    {
      "key": "identifier",
      "value": ""
    },
    {
      "key": "ActiveFhirVersion",
      "value": ""
    },
    {
      "key": "X-Fhir-By-Version",
      "value": ""
    },
    {
      "key": "clinicalImpressionId",
      "value": ""
    },
    {
      "key": "carePlanId",
      "value": ""
    },
    {
      "key": "bundleId1",
      "value": ""
    },
    {
      "key": "bundleError",
      "value": ""
    },
    {
      "key": "iprMREC",
      "value": ""
    },
    {
      "key": "encounterId",
      "value": ""
    },
    {
      "key": "bundleIdentifier",
      "value": ""
    },
    {
      "key": "ConditionId",
      "value": ""
    },
    {
      "key": "conditionId",
      "value": ""
    },
    {
      "key": "versionId",
      "value": ""
    }
  ]
}